traits_futures.multiprocessing_context module¶
Context providing multiprocessing-friendly worker pools, events, and routers.
-
class
traits_futures.multiprocessing_context.
MultiprocessingContext
[source]¶ Bases:
traits_futures.i_parallel_context.IParallelContext
Context for multiprocessing, suitable for use with the TraitsExecutor.
-
property
closed
¶ True if this context is closed, else False.
-
event
()[source]¶ Return a shareable event suitable for this context.
- Returns
event – An event that can be shared safely with workers. The event should have the same API as
threading.Event
andmultiprocessing.Event
, providing at a minimum theset
andis_set
methods from that API.- Return type
-
message_router
(event_loop)[source]¶ Return a message router suitable for use in this context.
- Parameters
event_loop (
IEventLoop
) – The event loop to interact with.- Returns
message_router
- Return type
-
property