EventManager
crawlee.events._event_manager.EventManager
Index
Constructors
Methods
Constructors
__init__
Create a new instance.
Parameters
persist_state_interval: timedelta = timedelta(minutes=1)keyword-only
close_timeout: timedelta | None = Nonekeyword-only
Returns None
Methods
__aenter__
Initializes the event manager upon entering the async context.
Returns EventManager
__aexit__
Closes the local event manager upon exiting the async context.
This will stop listening for the events, and it will wait for all the event listeners to finish.
Parameters
exc_type: type[BaseException] | None
exc_value: BaseException | None
exc_traceback: TracebackType | None
Returns None
emit
Emit an event.
Parameters
event: Eventkeyword-only
event_data: EventDatakeyword-only
Returns None
off
Remove a listener, or all listeners, from an Actor event.
Parameters
event: Eventkeyword-only
listener: Listener | None = Nonekeyword-only
Returns None
on
Add an event listener to the event manager.
Parameters
event: Eventkeyword-only
listener: Listenerkeyword-only
Returns None
wait_for_all_listeners_to_complete
Wait for all currently executing event listeners to complete.
Parameters
timeout: timedelta | None = Nonekeyword-only
Returns None
Event manager for registering, emitting, and managing event listeners.
Event manager allows you to register event listeners, emit events, and wait for event listeners to complete their execution. It is built on top of the
pyee.asyncio.AsyncIOEventEmitter
class.