Workers
Worker components used to perform “work” in independent threads or processes. Worker(s) are typically used by a Pool (circuits.core.pools) to create a pool of workers. Worker(s) are not registered with a Manager or another Component - instead they are managed by the Pool. If a Worker is used independently it should not be registered as it causes its main event handler _on_task to execute in the other thread blocking it.
Bases: circuits.core.events.Event
task Event
This Event is used to initiate a new task to be performed by a Worker or a Pool of Worker(s).
Parameters: |
|
---|
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Bases: circuits.core.components.BaseComponent
A thread/process Worker Component
This Component creates a Worker (either a thread or process) which when given a Task, will execute the given function in the task in the background in its thread/process.
Parameters: | process (bool) – True to start this Worker as a process (Thread otherwise) |
---|
initializes x; see x.__class__.__doc__ for signature