mistral.event_engine package

Submodules

mistral.event_engine.event_engine module

class mistral.event_engine.event_engine.EventDefinition(definition_cfg)

Bases: object

convert(event)
match_type(event_type)
class mistral.event_engine.event_engine.EventEngine

Bases: object

Event engine server.

A separate service that is responsible for listening event notification and triggering workflows defined by end user.

create_event_trigger(trigger, events)

An endpoint method for creating event trigger.

When creating an event trigger in API layer, we need to create a new listener or update an existing listener.

Parameters:
  • trigger – a dict containing event trigger information.
  • events – a list of events binding to the (exchange, topic) of the event trigger.
delete_event_trigger(trigger, events)

An endpoint method for deleting event trigger.

If there is no event binding to (exchange, topic) after deletion, we need to delete the related listener. Otherwise, we need to restart that listener.

Parameters:
  • trigger – a dict containing event trigger information.
  • events – a list of events binding to the (exchange, topic) of the event trigger.
process_notification_event(notification)

Callback funtion by event handler.

Just put notification into a queue.

stop_all_listeners()
update_event_trigger(trigger)

An endpoint method for updating event trigger.

Because only workflow related information is allowed to be updated, we only need to update event_triggers_map(in a synchronous way).

Parameters:trigger – a dict containing event trigger information.
class mistral.event_engine.event_engine.NotificationsConverter

Bases: object

convert(event_type, event)
get_event_definition(event_type)

mistral.event_engine.event_engine_server module

class mistral.event_engine.event_engine_server.EventEngineServer(event_engine)

Bases: mistral.service.base.MistralService

RPC EventEngine server.

This class manages event engine life-cycle and gets registered as an RPC endpoint to process event engine specific calls. It also registers a cluster member associated with this instance of event engine.

create_event_trigger(rpc_ctx, trigger, events)
delete_event_trigger(rpc_ctx, trigger, events)
start()
stop(graceful=False)
update_event_trigger(rpc_ctx, trigger)

Module contents