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.StoreEvent(source=None, **kwargs)

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

source

(Store instance) The key-value store which generated the event.

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

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

(string) The key which is involved in the event.

metadata

(dict) The metadata of the key which is involved in the event.

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

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

key

(string) The key which is involved in the event.

metadata

(dict) The metadata of the key which is involved in the event.

action

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

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

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

key

(string) The key which is involved in the event.

metadata

(dict) The metadata of the key which is involved in the event.

action

(‘set’) The modification action that was performed.

class encore.storage.events.StoreUpdateEvent(source=None, **kwargs)

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

key

(string) The key which is involved in the event.

metadata

(dict) The metadata of the key which is involved in the event.

action

(‘update’) The modification action that was performed.

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

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

key

(string) The key which is involved in the event.

metadata

(dict) The metadata of the key which is involved in the event.

action

(‘delete’) The modification action that was performed.

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

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

operation_id

A unique identifier for the operation being performed.

message

(string) A human-readable describing the operation being performed.

key

(string) The key which is involved in the event.

metadata

(dict) The metadata of the key which is involved in the event.

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

A unique identifier for the operation being performed.

message

(string) A human-readable describing the operation being performed.

key

(string) The key which is involved in the event.

metadata

(dict) The metadata of the key which is involved in the event.

steps

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

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

A unique identifier for the operation being performed.

message

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

key

(string) The key which is involved in the event.

metadata

(dict) The metadata of the key which is involved in the event.

step

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

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

A unique identifier for the operation that is finished.

message

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

key

(string) The key which is involved in the event.

metadata

(dict) The metadata of the key which is involved in the event.

exit_state

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