scille / autobahn-sync Goto Github PK
View Code? Open in Web Editor NEWBring autobahn to your synchronous apps !
License: MIT License
Bring autobahn to your synchronous apps !
License: MIT License
We were going to leverage this for a project, so I popped the example in to quickly evaluate it, but it didn't seem to run as expected out of the box?
When I ran the example in a fresh virtualenv for python 2.7 and 3.5, i see no output from the publish() calls. I flipped the print statements over to a logger and still saw no output?
In [1]: from time import sleep
...: from autobahn_sync import publish, call, register, subscribe, run
...:
...: import logging
...: logging.basicConfig(level=logging.DEBUG)
...: logger = logging.getLogger(__name__)
...:
...: @register('com.app.shout')
...: def shout(msg):
...: return msg.upper()
...:
...:
...: @subscribe('com.app.idea')
...: def on_thought(msg):
...: logger.info("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)
...:
INFO:twisted:Log opened.
DEBUG:autobahn:[MainThread] call bootstrap
DEBUG:autobahn:[CrochetReactor] start bootstrap
DEBUG:autobahn:[CrochetReactor] end bootstrap
DEBUG:autobahn:[CrochetReactor] start register_session
DEBUG:autobahn:Received WELCOME answer to our HELLO: Welcome(session=6306811870588809, roles={u'broker': broker(publisher_identification=True, pattern_based_subscription=True, subscription_meta_api=True, payload_encryption_cryptobox=True, payload_transparency=True, subscriber_blackwhite_listing=True, session_meta_api=True, publisher_exclusion=True, subscription_revocation=True), u'dealer': dealer(payload_encryption_cryptobox=True, payload_transparency=True, pattern_based_registration=True, registration_meta_api=True, shared_registration=True, caller_identification=True, session_meta_api=True, registration_revocation=True, progressive_call_results=True)}, realm=realm1, authid=53E5-HEUF-F9XR-QC3E-MMTP-WFVW, authrole=anonymous, authmethod=anonymous, authprovider=static, authextra=None)
DEBUG:autobahn:[CrochetReactor] callback resolve: Welcome(session=6306811870588809, roles={u'broker': broker(publisher_identification=True, pattern_based_subscription=True, subscription_meta_api=True, payload_encryption_cryptobox=True, payload_transparency=True, subscriber_blackwhite_listing=True, session_meta_api=True, publisher_exclusion=True, subscription_revocation=True), u'dealer': dealer(payload_encryption_cryptobox=True, payload_transparency=True, pattern_based_registration=True, registration_meta_api=True, shared_registration=True, caller_identification=True, session_meta_api=True, registration_revocation=True, progressive_call_results=True)}, realm=realm1, authid=53E5-HEUF-F9XR-QC3E-MMTP-WFVW, authrole=anonymous, authmethod=anonymous, authprovider=static, authextra=None)
DEBUG:autobahn:[MainThread] call decorated register/subscribe
DEBUG:autobahn:[MainThread] start callbacks runner
(Firstly, great module! Aside from this issue, it's working great)
When I initiate an RPC call that returns a large amount of data (>2MB), I get a TimeoutError from the call. I recreated the exact sequence with standard a Autobahn implementation and had no issues. Also, I note the timestamp that the server finishes transmitting the data. For the standard Autobahn implementation, the result is available on the client very soon after the server says it has finished. For the autobahn-sync implementation, nothing happens and the timeout occurs.
I've looked through Autobahn and Twisted's code to see if there is a max transimission size parameter somewhere and I can't seem to figure that out.
When an application is launched with the option blocking=True the registeration of the different callback must be before the start
After calling app.stop()
, the (web)socket is left open, according to netstat
. Doing app.run()
after stop()
opens a new socket, but the old one is left open.
Is this intended behaviour?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.