You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by Michi Mutsuzaki <mi...@cs.stanford.edu> on 2012/06/19 08:01:58 UTC

the ordering of async and sync requests

If the user calls an async request followed by a sync request, does
the zookeeper client guarantee that the sync request won't return
until the async request callback is invoked? The C client seems to let
the sync request return first if the sync request was sent from the
watch triggered by the async request.

Thanks!
--Michi

Re: the ordering of async and sync requests

Posted by Patrick Hunt <ph...@apache.org>.
On Mon, Jun 18, 2012 at 11:01 PM, Michi Mutsuzaki <mi...@cs.stanford.edu> wrote:
> If the user calls an async request followed by a sync request, does
> the zookeeper client guarantee that the sync request won't return
> until the async request callback is invoked? The C client seems to let
> the sync request return first if the sync request was sent from the
> watch triggered by the async request.

There are no such guarantees. If you need ordering guarantees in this
case then either do everything async or sync (single thread), but
don't mix them.

Patrick