crossbario / crossbario/autobahn-python
Component close/reconnect behavior using RawSocket
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 768
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Component API example, focusing on the rawsocket transport and the await comp.stop() call inside the on_join handler; compare its behavior with the websocket example. No source files or tests are named in the issue, so first locate the RawSocket connection shutdown and reconnect entry points. Done means an orderly user-initiated stop does not trigger automatic reconnection attempts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100