No project description provided
Project description
promulgate
Simple single threaded event library. Inspired by this[https://stackoverflow.com/a/2022629] stackoverflow answer.
Example
from dataclasses import dataclass
from promulgate import Promulgation
@dataclass
class RegisterUserPromulgation(Promulgation)
email: str
password: str
def handle_register_user(prmlg : RegisterUserPromulgation) -> None:
print(f"New user with email {prmlg.email} and password ***")
RegisterUserPromulgation.subscribe(handle_register_user)
event = RegisterUserPromulgation("test@test.com", "super.1.secret!")
event.promulgate()
# New user with email test@test.com and password ***
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
promulgate-0.1.1.tar.gz
(1.4 kB
view hashes)
Built Distribution
Close
Hashes for promulgate-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3610b8cb1d88f42ed6c6a7d763c4efca213aa012d07ceba7827d0ec303224322 |
|
MD5 | b9f795d4ae94e5d3bc46d35fa3e4940c |
|
BLAKE2b-256 | d58539fab49b548a580e3fc2a812a07d52c40411af677ebd533d425a011710e8 |