Bring autobahn to your synchronous apps !
Project description
Autobahn~Sync
Autobahn integration with crochet to provide WAMP for synchronous applications.
Originaly based on the work of Sam & Max (warning: French, pr0n and awesomeness inside !).
Quick example
from time import sleep
from autobahn_sync import publish, call, register, subscribe, run
@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)
run()
while True:
print(call('com.app.shout', 'Autobahn is cool !'))
publish('com.app.idea', 'Use autobahn everywhere !')
sleep(1)
This code will connect to the crossbar router (don’t forget to start it before trying this snippet !) listening 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
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
autobahn-sync-0.2.3.tar.gz
(7.1 kB
view details)
File details
Details for the file autobahn-sync-0.2.3.tar.gz
.
File metadata
- Download URL: autobahn-sync-0.2.3.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65d13502be6f3a33e46a5b766d5c1e5c23179d284155cd7e3413a01ae5444147 |
|
MD5 | 5de9baf3aceab5b0297bbc5d6a8b4206 |
|
BLAKE2b-256 | a936d310ad64132c6689a39c0d1787ce45527f90b833c44d9fceabbd949a3f53 |