autobahn-python: Config/Settings to ApplicationRunner (openHandshakeTimeout)

Hi, How can I override default openHandshakeTimeout param? I am going run ApplicationRunner with greater handshake timout in python code. I have tried, but nothing: subscriber = ApplicationRunner(url=u"wss://api.....", realm=u"realm1",extra={'openHandshakeTimeout':10})

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 3
  • Comments: 35 (22 by maintainers)

Most upvoted comments

Have you looked at the (in-progress) Component API? On master this allows changing the handshake timeout, too. It only currently works with Twisted (not yet asyncio) but of course that is planned.

For your use-case that would look something like this:

from autobahn.twisted.component import Component, run

component = Component(
    transports=[
        "type": "websocket",
        "url": u"wss://api.poloniex.com",
        "options": {
            "open_handshake_timeout": 60.0,
        }
    ],
    realm=u'realm1',
    # authentication= {...} if you need too
)

def on_event(*args):
    print('{0}: {1} A:{2} B:{3} {4}% V:{5} H:{8} L:{9}'.format(*args))

@component.on_join
@inlineCallbacks
def join(session, details):
    print("Session {} joined: {}".format(details.session, details))
    yield session.subscribe(on_event, 'ticker')

if __name__ == '__main__':
    run(component)

Is this API easier to understand? Although you can still use an ApplicationSession subclass if you want, there’s no need to subclass to use it…

Interesting! They must be running a quite old version of Crossbar.io, which you can tell from the WebSocket upgrade header: 'x-powered-by': 'AutobahnPython/0.13.0'.

We (Crossbar.io GmbH) are offering commercial support for Crossbar.io and all Autobahn client libraries, and as they are running a commercial venture, we’d be happy to address these issues under a support contract. We currently are working with a couple of companies already, and because of limited resources, we prioritize paying customers.

I’m kinda stuck waiting for this fix to be able to work with a server under heavy load that usually takes longer to complete handshake.

The hard-coded values in https://github.com/crossbario/autobahn-python/blob/master/autobahn/twisted/wamp.py#L256 would still override the fix in #844? Would love it if you would correct that before doing the next release.

I tried using the head of master after #844, and passing the options to the extra kwarg in the ApplicationRunner, which I assume should get passed as these new component options, but to no avail.

This isn’t currently exposed at the ApplicationRunner level (only on the underlying WebSocketFactory level).