Class t.i.d.DeferredSemaphore(_ConcurrencyPrimitive):

Part of twisted.internet.defer View Source View In Hierarchy

A semaphore for event driven systems.

API stability: Unstable
Line # Kind Name Docs
751 Method __init__ Undocumented
756 Method acquire Attempt to acquire the token.
770 Method release Release the token.

Inherited from _ConcurrencyPrimitive:

Line # Kind Name Docs
671 Method _releaseAndReturn Undocumented
675 Method run Acquire, run, release.
def __init__(self, tokens):
Undocumented
def acquire(self):
Attempt to acquire the token.
Returnsa Deferred which fires on token acquisition.
def release(self):

Release the token.

Should be called by whoever did the acquire() when the shared resource is free.