Skip to main content
Version: Next

ApifyEventManager

Event manager for the Apify platform.

This class extends Crawlee's EventManager to provide Apify-specific functionality, including websocket connectivity to the Apify platform for receiving platform events.

The event manager handles:

  • Registration and emission of events and their listeners.
  • Websocket connection to Apify platform events.
  • Processing and validation of platform messages.
  • Automatic event forwarding from the platform to local event listeners.

This class should not be used directly. Use the Actor.on and Actor.off methods to interact with the event system.

Index

Methods

__aenter__

  • async __aenter__(): Self
  • Initialize the event manager upon entering the async context.

    On the outermost entry, it connects to the platform events websocket and starts consuming its messages.


    Returns Self

__aexit__

  • async __aexit__(exc_type, exc_value, exc_traceback): None
  • Close the event manager upon exiting the async context.

    On the outermost exit, it stops consuming the platform messages and closes the websocket connection.


    Parameters

    • exc_type: type[BaseException] | None
    • exc_value: BaseException | None
    • exc_traceback: TracebackType | None

    Returns None

__init__

  • __init__(configuration): None
  • Initialize a new instance.


    Parameters

    • configuration: Configuration

      The Actor configuration for the event manager.

    Returns None

Page Options