Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/pyee/__init__.py: 75%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# -*- coding: utf-8 -*-
3"""
4pyee supplies a `EventEmitter` class that is similar to the
5`EventEmitter` class from Node.js. In addition, it supplies the subclasses
6`AsyncIOEventEmitter`, `TwistedEventEmitter` and `ExecutorEventEmitter`
7for supporting async and threaded execution with asyncio, twisted, and
8concurrent.futures Executors respectively, as supported by the environment.
10# Example
12```text
13In [1]: from pyee.base import EventEmitter
15In [2]: ee = EventEmitter()
17In [3]: @ee.on('event')
18 ...: def event_handler():
19 ...: print('BANG BANG')
20 ...:
22In [4]: ee.emit('event')
23BANG BANG
25In [5]:
26```
28"""
30from pyee.base import EventEmitter, Handler, PyeeError, PyeeException
32__all__ = ["EventEmitter", "Handler", "PyeeError", "PyeeException"]