ezmsg.baseproc.stateful#
Stateful processor base classes for ezmsg.
Classes
- class BaseAdaptiveTransformer(*args, **kwargs)[source]#
Bases:
BaseStatefulTransformer[SettingsType,MessageInType,MessageOutType|None,StateType],ABC,Generic[SettingsType,MessageInType,MessageOutType,StateType]
- class BaseAsyncTransformer(*args, **kwargs)[source]#
Bases:
BaseStatefulTransformer[SettingsType,MessageInType,MessageOutType,StateType],ABC,Generic[SettingsType,MessageInType,MessageOutType,StateType]This reverses the priority of async and sync methods from
BaseStatefulTransformer. Whereas inBaseStatefulTransformer, the async methods simply called the sync methods, here the sync methods call the async methods, more similar toBaseStatefulProducer.
- class BaseStatefulConsumer(*args, **kwargs)[source]#
Bases:
BaseStatefulProcessor[SettingsType,MessageInType,None,StateType],ABC,Generic[SettingsType,MessageInType,StateType]Base class for stateful message consumers that don’t produce output. This class merely overrides the type annotations of BaseStatefulProcessor.
- class BaseStatefulProcessor(*args, **kwargs)[source]#
Bases:
BaseProcessor[SettingsType,MessageInType,MessageOutType],Stateful[StateType],ABC,Generic[SettingsType,MessageInType,MessageOutType,StateType]Base class implementing common stateful processor functionality. You probably do not want to inherit from this class directly. Refer instead to the more specific base classes. Use BaseStatefulConsumer for operations that do not return a result, or BaseStatefulTransformer for operations that do return a result.
- class BaseStatefulProducer(*args, **kwargs)[source]#
Bases:
BaseProducer[SettingsType,MessageOutType],Stateful[StateType],ABC,Generic[SettingsType,MessageOutType,StateType]- Base class implementing common stateful producer functionality.
Examples of stateful producers are things that require counters, clocks, or to cycle through a set of values.
- Unlike BaseStatefulProcessor, this class does not message hashing because there
are no input messages. We still use self._hash to simply track the transition from initialization (.hash == -1) to state reset (.hash == 0).
- class BaseStatefulTransformer(*args, **kwargs)[source]#
Bases:
BaseStatefulProcessor[SettingsType,MessageInType,MessageOutType,StateType],ABC,Generic[SettingsType,MessageInType,MessageOutType,StateType]Base class for stateful message transformers that produce output. This class merely overrides the type annotations of BaseStatefulProcessor.