Skip to main content

A singleton based thread-safe event system which components can use to subscribe and post to other components.

Project description

Events System

  • EventsSystem
    • A singleton based thread-safe event system, which components can use to subscribe and post to other components.
    • install: pip install events-system
    • import: import EventsSystem
    • import EventListener: from events_system.event_listener import EventListener
    • subscribe: EventsSystem.subscribe("event_type", function)
    • post: EventsSystem.post(event_type)
    • example use: Create an abstract class as listener to a concrete component by subclassing EventListener and defining an abstract function along the lines of setup_ConcreteComponent_listener. In its abstract function, this component listener must call super().setup_event_handlers() to which the subscription dictionary {"event_type":function} is passed. Whatever other component needs to be informed about these events, can now implement that component listener and pass their subscription dictionary to the function.

Project details


Download files

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

Source Distribution

events-system-0.0.4.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

events_system-0.0.4-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page