Skip to main content

minimalistic event system (a bag of handlers)

Project description


minimalistic event system

Installation via pip
(runs on Python 3)


Registered handlers (a bag of handlers) getting called when event gets fired
using ideas from "axel events"
and "event system" from


from visitoolkit_eventsystem import eventsystem

# handlers are callback functions in your code,
# when firing an event visitoolkit_eventsystem will call them with the given argument(s)
def cb1(event_id, *arg, **args):
    if event_id > 0:
        # handle event...
        return True
        return False

# Default is synchronous execution of handlers (blocking main thread, collecting all results)
# sync_mode=False means asynchronous execution of handlers (one background thread calls all handlers) 
# =>Details about flag "exc_info"(default is True):
# =>Flag "traceback" (default is False) controls verbosity of error_info when an exception occurred
es = eventsystem.EventSystem(sync_mode=True)

# adding or removing handlers in list-like syntax
es += cb1

#The execution result is returned as a list containing all results per handler having this structure:
#  exec_result = [
#      (True, result, handler),        # on success
#      (False, error_info, handler),   # on error
#      (None, None, handler), ...      # asynchronous execution
#  ]

# firing event
result = es(42)

Increasing logging level for bughunting:

import logging

background information

visitoolkit_eventsystem is used in visitoolkit_connector as core part of visitoolkit.

visitoolkit is written for the proprietary Building and Process Management System 'ProMoS NT' (c) MST Systemtechnik AG'
(also known as 'Saia Visi.Plus' (c) Saia-Burgess Controls AG)

Support creator of visualisation projects...
Add efficiency...
Reduce manual error-prone processes...
Add missing features...

Disclaimer: Use 'visitoolkit' at your own risk!

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
visitoolkit_eventsystem-0.1.5-py3-none-any.whl (7.1 kB) Copy SHA256 hash SHA256 Wheel py3
visitoolkit-eventsystem-0.1.5.tar.gz (22.6 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page