sasync.queue.Factory(object)
class documentation
Part of sasync.queue
(View In Hierarchy)
I generate asynqueue.ThreadQueue
objects, a unique one for
each call to me with a unique url-kw combination.
Method | __init__ | Undocumented |
Static Method | newQueue | Returns a Deferred that fires with a new
asynqueue.ThreadQueue that has a new SQLAlchemy engine
attached as its engine attribute. |
Class Method | getGlobal | Returns a deferred reference to the global queue, assuming one has been
defined with setGlobal . |
Class Method | setGlobal | Sets up a global queue and engine, storing as the default and returning a deferred reference to it. |
Method | kill | Removes the supplied queue object from my local queue cache and shuts
down the queue. Returns a Deferred that fires when the removal
and shutdown are done. |
Method | __call__ | No summary |
def newQueue(url, **kw):
Returns a Deferred
that fires with a new
asynqueue.ThreadQueue
that has a new SQLAlchemy engine
attached as its engine attribute.
def getGlobal(cls):
Returns a deferred reference to the global queue, assuming one has been
defined with setGlobal
.
Calling this method, or calling an instance of me without a url argument, is the only approved way to get a reference to the global queue.
def setGlobal(cls, url, **kw):
Sets up a global queue and engine, storing as the default and returning a deferred reference to it.
Calling this method is the only approved way to set the global queue.
Removes the supplied queue object from my local queue cache and shuts
down the queue. Returns a Deferred
that fires when the removal
and shutdown are done.
Has no effect on the global queue.
Returns a Deferred
that fires with an
asynqueue.ThreadQueue
that has an SQLAlchemy
engine attached to it, constructed with the supplied url and any keywords.
The engine can be referenced via the queue's engine attribute.
If a queue has already been constructed with the same url-kw parameters, that same one is returned. Otherwise, a new one is constructed and saved for a repeat call.
If there is no url argument, the global default queue will be returned. There must be one for that to work, of course.
Separate instances of me can have separate queues for the exact same url-kw parameters. But all instances share the same global queue.