Skip to main content

smoke

A concise Publish/Subscribe utility module. It supports both free-form signal names and a stricter style where signals are declared first. You can also mix them.

https://secure.travis-ci.org/keis/smoke.png?branch=master https://coveralls.io/repos/keis/smoke/badge.png?branch=master

Usage

import smoke

class MyCls(smoke.Broker):
    appears = smoke.signal('appears')
    leaves = smoke.signal('leaves')

def say_hello(what):
    print("hello %s" % (what,))

def say_goodbye(what):
    print("good bye %s" % (what,))

# Using broker
o = MyCls()
o.subscribe("appears", say_hello)
o.publish("appears", what='world')

# Using declared signals
o = MyCls()
o.leaves.subscribe(say_goodbye)
o.leaves.publish(what='world')

# Mixing
o = MyCls()
o.subscribe("appears", say_hello)
o.appears.publish()

Metadata

Release files for smoke 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smoke 0.2.0
File Size Uploaded
smoke-0.2.0.tar.gz 4.6 kB Details

Release files / smoke-0.2.0.tar.gz

Download URL smoke-0.2.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
590524074972eb9cbb8823c25fc7d112441d49711d8904195cb3f05e1e69bbad
BLAKE2b-256 checksum
How to use checksums
1c5a550f7cce4d9c7bce0c3139d164fb40fb9fdccb3ea5f8dcb80aef15b9c9d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page