Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component close/reconnect behavior using RawSocket #1530

Open
oberstet opened this issue Mar 4, 2022 · 0 comments
Open

Component close/reconnect behavior using RawSocket #1530

oberstet opened this issue Mar 4, 2022 · 0 comments

Comments

@oberstet
Copy link
Contributor

oberstet commented Mar 4, 2022

When using RawSocket on the Component API, and closing the component's session from user code in an orderly fashion, no automatic reconnection attempts should happen.

import asyncio
import time

from autobahn.asyncio import component

# works as expected
transports=dict(
    type='websocket',
    url='ws://127.0.0.1:8080/ws',
)

# doesn't work properly
transports=dict(
    type='rawsocket',
    url='rs://127.0.0.1:8081',
)

comp = component.Component(
    transports=transports,
)

@comp.on_join
async def _(session, details):
    await asyncio.sleep(2)
    await comp.stop()

component.run([comp])

Original issue from OP on forum https://forum.crossbar.io/t/howto-ask-a-component-to-close-cleanly/2077

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant