Skip to main content

Publish-Subscribe framework

Project description

This package offers a “publish-subscribe” framework.

The framework can be used to implement basic “actors” where each “actor” is contained in a python module. The function “upub” can be used to queue a message in front instead of the normal tail.

Small Example

## Actor 1 in module1.py
##
from subpub import sub, pub

@sub
def on_topic1(param1):
    print "module1/topic1: ", param1

@sub
def on_topic2(param1):
    print "module1/topic2: ", param1


## Actor 2 in module2.py
##
from subpub import sub, pub

@sub
def on_topic1(param1):
    print "module2/topic1: ", param1

pub("topic1", "value1")
pub("topic2", "value2")

The example above would yield:

"module1/topic1: value1"
"module2/topic1: value1"
"module1/topic2: value2"

Project details


Download files

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

Files for pysubpub, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size pysubpub-0.2.0.tar.gz (4.1 kB) File type Source Python version None Upload date Hashes View
Filename, size pysubpub-0.2.0.zip (7.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page