The asynchronous interface to the SDK is a work in progress, and is currently
intended to be used by integrators into higher level async wrappers. See
txcouchbase package for an example.
This document largely explains the current internals of how the Couchbase async module works in a lower level. For a higher level overview, see: http://blog.couchbase.com/python-sdk-and-twisted
The Key-Value interface of the async subsystem functions as closely
as possible like its synchronous counterpart. The primary difference is that
where the synchronous interface would return an instance of a
Result or a
the asynchronous interface returns an
object contains fields for two callbacks which are
invoked when the result is ready. One is the
field which is called with a
MultiResult upon success,
and the other is the
errback field which is invoked
with an exception object upon error.
The semantics of when an exception is passed follows the rules of the
quiet parameter just like the synchronous API.
- class couchbase_core.result.AsyncResult¶
Different from the key-value interface, the synchronous view API
View object which
is itself an iterator which yields results. Because this is a synchronous
API, the iterator interface must be replaced with a class interface
which must be subclassed by a user.
- class couchbase_core.asynchronous.view.AsyncViewBase¶
The async API is divided into several sections. In order to have an async
client which interacts with other async libraries and frameworks, it is
necessary to make the Couchbase extension aware of that environment. To this
IOPS interface is provided. The
API is entirely separate from the key-value API and should be treated as
belonging to a different library. It is simply the extension’s I/O
- class couchbase_core.iops.base.Event¶
This class represents an Event. This concept should be familiar to the intended audience, who should be familiar with event loops and their terminology. It represents a certain event in the future, which shall be triggered either by something happening or by the passage of time.
When said event takes place, the object should be signalled via the
- class couchbase_core.iops.base.IOEvent¶
A subclass of
Event, this represents a socket. Events applied to this socket are triggered when the socket becomes available for reading or writing.
- class couchbase_core.iops.base.IOPS¶
Action indicating the specific event should be added to the event loop’s “watcher” list, and should be have its
ready()method called when the IO implementation has detected the specific event is ready
Action indicating that the specific object should not be notified when the IO state changes. This is typically done by removing it from the watcher list
Action to permanently erase any references to this event
IO Event Constants¶
IO Flag indicating that this event should be notified on file readbility
IO flag indicating that this event should be notified on file writeability