Event Source

class gpype.backend.sources.base.event_source.EventSource[source]

Bases: Source

Event-driven source for asynchronous data generation.

Generates events in response to external triggers.

__init__(**kwargs)[source]

Initialize event source with asynchronous output configuration.

Parameters:

**kwargs – Additional arguments for parent Source class including channel_count, frame_size, and other configuration parameters.

start()[source]

Start event source.

stop()[source]

Stop event source.

trigger(value, port_name='out')[source]

Trigger an event with the specified value.

Parameters:
  • port_name – Name of the output port to trigger.

  • value – Event value to be transmitted. Converted to appropriate data type and formatted as single-sample array.

step(data)[source]

Return current event data if available.

Parameters:

data (dict[str, ndarray]) – Input data dictionary (unused for source nodes).

Return type:

dict[str, ndarray]

Returns:

Dictionary containing event data if event is active, empty dict otherwise.