eventify’s documentation

eventify package

Subpackages

eventify.drivers package

Submodules
eventify.drivers.crossbar module

Crossbar Driver Module

class eventify.drivers.crossbar.Component(config=None)[source]

Bases: eventify.drivers.base.BaseComponent, autobahn.asyncio.wamp.ApplicationSession

Handle subscribing to topics

emit_event(event)[source]

Publish an event back to crossbar :param event: Event object

log = <Logger eventify.drivers.crossbar (WARNING)>
lookup_session(topic_name)[source]

Attempts to find the session id for a given topic

http://crossbar.io/docs/Subscription-Meta-Events-and-Procedures/

onClose(wasClean)[source]

Disconnect when connection to message broker is lost

onDisconnect()[source]

Event fired when transport is lost

onJoin(details)[source]

Implements autobahn.wamp.interfaces.ISession.onJoin()

onLeave(reason=None, message=None)[source]
Parameters
  • reason

  • message

onUserError(fail, message)[source]

Handle user errors

show_sessions()[source]

Returns an object with a lists of the session IDs for all sessions currently attached to the realm

http://crossbar.io/docs/Session-Metaevents-and-Procedures/

total_sessions()[source]

Returns the number of sessions currently attached to the realm.

http://crossbar.io/docs/Session-Metaevents-and-Procedures/

class eventify.drivers.crossbar.Service(driver='crossbar', config_file='config.json', handlers=None)[source]

Bases: eventify.Eventify

Create crossbar service

check_transport_host()[source]

Check if crossbar port is open on transport host

reconnect()[source]

Handle reconnect logic if connection to crossbar is lost

setup_runner()[source]

Setup instance of runner var

start(start_loop=True)[source]

Start a producer/consumer service

Module contents

eventify.event package

Module contents

Event Module

class eventify.event.Event(event, **kwargs)[source]

Bases: object

Event object

eventify.event.replay_events()[source]

Replay events from a given timestamp or event_id :param timestamp: Human readable datetime :param event_id: UUID of a given event

eventify.exceptions package

Module contents

Eventify exceptions

exception eventify.exceptions.EventifyConfigError(message)[source]

Bases: Exception

Configuration related errors

exception eventify.exceptions.EventifyHandlerInitializationFailed(message)[source]

Bases: Exception

Error initialization of handler. It means that we can not continue working so service should be stopped

with non zero exit code

exception eventify.exceptions.EventifyInitError(message)[source]

Bases: Exception

Initialization errors

exception eventify.exceptions.EventifyPersistanceConfigError(message)[source]

Bases: Exception

Errors with persistance configuration

exception eventify.exceptions.EventifySanityError(message)[source]

Bases: Exception

Errors with security and sanity

eventify.persist package

Submodules
eventify.persist.constants module

Eventify Persistance Configuration

Module contents

Persist Helper Module

eventify.persist.persist_event(topic, event, pool)[source]

Track event to prevent duplication of work and potential loss of event :param topic: The event topic :param event: The event object

eventify.tracking package

Submodules
eventify.tracking.constants module

Eventify Tracking Constants

class eventify.tracking.constants.EventState[source]

Bases: object

Event States

completed = 'COMPLETED'
inflight = 'IN-FLIGHT'
started = 'STARTED'
Module contents

Event Tracking Module

eventify.tracking.track_event(event, state, service_name)[source]

Store state of events in memory :param event: Event object :param state: EventState object :param service_name: Name of service name

Submodules

eventify.base_handler module

Abstract Base Class for Handler

class eventify.base_handler.BaseHandler[source]

Bases: object

Base event handler

publish_topic = None
session = None
set_session(session)[source]

Setup session for publishing

subscribe_topic = None

eventify.service module

Service Module

class eventify.service.Service(driver='crossbar', config_file='config.json', handlers=None)[source]

Bases: eventify.drivers.crossbar.Service

Crossbar Service

eventify.service.event_tracker(func)[source]

Event tracking handler

Module contents

Eventify! A simple module for implementing event driven systems

class eventify.Eventify(driver='crossbar', config_file='config.json', handlers=None)[source]

Bases: object

Base Class for eventify

static check_event_loop()[source]

Check if event loop is closed and create a new event loop

config_sanity_check()[source]

Base configuration sanity checks

load_config

Load configuration for the service

Parameters

config_file – Configuration file path

set_missing_defaults()[source]

Ensure that minimal configuration is setup and set defaults for missing values

Summary

A simple python module for building event driven systems.

Indices and tables