Events

The Storage API generates events using the Encore Event API. This module defines the event classes that are required aby the abstract API.

Event Inheritance Diagram

The following diagram shows the inheritance heirarchy of the various Event subclasses defined in this module. When listening for events, you may want to listen on appropriate superclasses.

Inheritance diagram of encore.events.api.BaseEvent, encore.events.progress_events.ProgressEvent, encore.events.progress_events.ProgressStartEvent, encore.events.progress_events.ProgressStepEvent, encore.events.progress_events.ProgressEndEvent, StoreEvent, StoreTransactionEvent, StoreTransactionStartEvent, StoreTransactionEndEvent, StoreKeyEvent, StoreModificationEvent, StoreSetEvent, StoreUpdateEvent, StoreDeleteEvent, StoreProgressEvent, StoreProgressStartEvent, StoreProgressStepEvent, StoreProgressEndEvent

Storage Events

This module contains asbtract and concrete Event subclasses that support the Storage API.

class encore.storage.events.StoreDeleteEvent(source=None, **kwargs)[source]

An event generated when a value is deleted into a Key-Value Store

key

The key which is involved in the event.

Type:

string

metadata

The metadata of the key which is involved in the event.

Type:

dict

action

The modification action that was performed.

Type:

‘delete’

class encore.storage.events.StoreEvent(source=None, **kwargs)[source]

An abstract base class for events generated by a Key-Value Store

source

The key-value store which generated the event.

Type:

Store instance

class encore.storage.events.StoreKeyEvent(source=None, **kwargs)[source]

An abstract base class for events related to a particular key in the store. This should provide the key and metadata (if available) of the modified key.

key

The key which is involved in the event.

Type:

string

metadata

The metadata of the key which is involved in the event.

Type:

dict

class encore.storage.events.StoreModificationEvent(source=None, **kwargs)[source]

An abstract base class for modification events generated by a Key-Value Store

key

The key which is involved in the event.

Type:

string

metadata

The metadata of the key which is involved in the event.

Type:

dict

action

The modification action that was performed. One of ‘set’, ‘update’ or ‘delete’.

Type:

string

class encore.storage.events.StoreProgressEndEvent(source=None, **kwargs)[source]
operation_id

A unique identifier for the operation that is finished.

message

A human-readable describing the state of the operation that ended.

Type:

string

key

The key which is involved in the event.

Type:

string

metadata

The metadata of the key which is involved in the event.

Type:

dict

exit_state

A constant describing the end state of the operation. One of normal, warning, error or exception.

Type:

string

class encore.storage.events.StoreProgressEvent(source=None, **kwargs)[source]

Abstract base class for ProgressEvents generated by a Key-Value Store

operation_id

A unique identifier for the operation being performed.

message

A human-readable describing the operation being performed.

Type:

string

key

The key which is involved in the event.

Type:

string

metadata

The metadata of the key which is involved in the event.

Type:

dict

class encore.storage.events.StoreProgressStartEvent(source=None, **kwargs)[source]
operation_id

A unique identifier for the operation being performed.

message

A human-readable describing the operation being performed.

Type:

string

key

The key which is involved in the event.

Type:

string

metadata

The metadata of the key which is involved in the event.

Type:

dict

steps

The number of steps in the operation. If unknown or variable, use -1.

Type:

int

class encore.storage.events.StoreProgressStepEvent(source=None, **kwargs)[source]
operation_id

A unique identifier for the operation being performed.

message

A human-readable describing the state of the operation being performed.

Type:

string

key

The key which is involved in the event.

Type:

string

metadata

The metadata of the key which is involved in the event.

Type:

dict

step

The count of the step. If unknown, use -1.

Type:

int

class encore.storage.events.StoreSetEvent(source=None, **kwargs)[source]

An event generated when a value is set into a Key-Value Store

key

The key which is involved in the event.

Type:

string

metadata

The metadata of the key which is involved in the event.

Type:

dict

action

The modification action that was performed.

Type:

‘set’

class encore.storage.events.StoreTransactionEndEvent(source=None, **kwargs)[source]
class encore.storage.events.StoreTransactionEvent(source=None, **kwargs)[source]
class encore.storage.events.StoreTransactionStartEvent(source=None, **kwargs)[source]
class encore.storage.events.StoreUpdateEvent(source=None, **kwargs)[source]

An event generated when a value is updated into a Key-Value Store

key

The key which is involved in the event.

Type:

string

metadata

The metadata of the key which is involved in the event.

Type:

dict

action

The modification action that was performed.

Type:

‘update’