Name

lcb_wait — Wait for events

Synopsis

cc [ flag … ] file… -lcouchbase [ library … ]

#include <libcouchbase/couchbase.h>
lcb_error_t lcb_wait(lcb_t instance);
lcb_error_t lcb_breakout(lcb_t instance);
int lcb_is_waiting(lcb_t instance);

DESCRIPTION

libcouchbase is implemented in a fully anynchronous way, but to allow users to use libcouchbase without an event loop libcouchbase provides simple primitives to wait for operations.

The function lcb_wait() will run the event loop and wait for the completion of all scheduled operations. The function lcb_breakout may be used from within a callback to break out of a call to lcb_wait. The function lcb_is_waiting() may be used from within a callback to check if the system is "blocked" by a call to lcb_wait().

RETURN VALUES

lcb_wait() and lcb_breakout() return LCB_SUCCESS on success, or an error code describing the error otherwise. See lcb_strerror(3couchbase) for more information about error codes.

lcb_is_waiting() returns a non-zero value if the instance is currently blocked by a call to lcb_wait().

ATTRIBUTES

See lcb_attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE

Interface Stability

Committed

MT-Level

MT-Safe

COPYRIGHT

Copyright 2010-2013 Couchbase, Inc.

SEE ALSO

Learn more at http://www.couchbase.com/communities/c.

libcouchbase(3lib), lcb_create(3couchbase), lcb_attributes(5)