fusionsc.asnc.FiberPool

class fusionsc.asnc.FiberPool

Despite python’s extensive support for coroutines, it can sometimes be neccessary to use the blocking Promise.wait(…) function inside a coroutine (e.g. if using an external library, which commonly is not directly compatible with event- loops). Since this would block the very event loop that processes the promise, this is not possible.

Fiber pools resolve this issue by allowing to start a callable as a pseudo-thread (referred to as a “fiber”), which maintains its own stack, but is otherwise contained in the active thread and follows the same cooperative scheduling. Calling “wait” on any promise inside the fiber will suspend the fiber and continue event loop scheduling until the promise resolved, at which point the fiber will continue execution. Like with coroutines, the active thread will not perform other tasks while fiber is active (which eliminates the need for locking between fibers).

Methods

__init__(self, arg0)

startFiber(self, arg0)

Methods

FiberPool.__init__(self: fusionsc.native.asnc.FiberPool, arg0: int) None
FiberPool.startFiber(self: fusionsc.native.asnc.FiberPool, arg0: object) None