Package elisa :: Package core :: Package utils :: Module defer

Module defer

source code

Functions
Deferred
succeed(result)
see twisted.internet.defer.succeed.
source code
Deferred
fail(result=None)
see twisted.internet.defer.fail.
source code
Deferred
execute(callable, *args, **kw)
see twisted.internet.defer.execute.
source code
 
timeout(deferred) source code
tuple
deferred_accumulator(invocation_hint, return_accu, handler_return)
Accumulator to use with gobject signals where callbacks are supposed to return a Deferred.
source code
Variables
  Deferred = defer.Deferred
  CancelledError = defer.CancelledError
  DeferredList = defer.DeferredList
  FAILURE = defer.FAILURE
  SUCCESS = defer.SUCCESS
  TimeoutError = defer.TimeoutError
  AlreadyCalledError = defer.AlreadyCalledError
  gatherResults = defer.gatherResults
  maybeDeferred = defer.maybeDeferred
  waitForDeferred = defer.waitForDeferred
  deferredGenerator = defer.deferredGenerator
  inlineCallbacks = defer.inlineCallbacks
  DeferredLock = defer.DeferredLock
  DeferredSemaphore = defer.DeferredSemaphore
  DeferredQueue = defer.DeferredQueue
  DeferredFilesystemLock = defer.DeferredFilesystemLock
  AlreadyTryingToLockError = defer.AlreadyTryingToLockError

Imports: defer, failure, cancellable_defer


Function Details

fail(result=None)

source code 

see twisted.internet.defer.fail. The biggest difference is that the twisted API allows you to call this without any parameters, which leads to an error. See http://twistedmatrix.com/trac/ticket/3145.

Returns: Deferred

deferred_accumulator(invocation_hint, return_accu, handler_return)

source code 

Accumulator to use with gobject signals where callbacks are supposed to return a Deferred. With this, emit() will return a list of all the Deferred returned by the connected callbacks. It ignores callback return values that are not Deferreds.

Parameters:
  • invocation_hint (tuple) - (signal_id, detail, run_type) (this parameter is ignored)
  • return_accu (list) - a list of Deferred (or possibly None)
  • handler_return (elisa.core.utils.Deferred) - The return value of the signal handler
Returns: tuple
a tuple containing True and a list of deferreds.