Skip to main content

Bring autobahn to your synchronous apps !

Project description

Travis-CI

Autobahn~Sync

Autobahn integration with crochet to provide WAMP for synchronous applications.

Originaly based on the work of Sam & Max.

Quick example

from autobahn_sync import publish, call, register, subscribe, start

start()


@register('com.app.shout')
def shout(msg):
    return msg.upper()


@subscribe('com.app.idea')
def on_thought(msg):
    print("I've just had a new idea: %s" % msg)


print(call('com.app.shout', 'Autobahn is cool !'))
publish('com.app.idea', 'Use autobahn everywhere !')

This code will connect to the crossbar router (don’t forget to start it before trying this snippet !) listenening ws://127.0.0.1:8080/ws and register itself in realm realm1.

Also see the examples for more usecases

Bonus

See extensions folder for a nice Flask extension ;-)

Get it now

pip install -U autobahn-sync

License

MIT licensed. See the bundled LICENSE file for more details.

Project details


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