Comments (6)
Similar to: crossbario/autobahn-java#24
from autobahn-js.
I think that the auto-resubscribe should be optional, and disabled by default. The reconnect will trigger a onOpen, which is the place where prefix setup and subscribing usually takes place, at least in the demo code provided, so there will be some kind of action duplication.
Maybe the auto-reconnect should limit itself to discovering the disconnection - which always fires an onClose - and attempting to reconnect, so that the user of the library doesn't have to code this. A reconnect should then behave just like a first time connect. Eventually a flag could be set in a variable which could be queried to see if the onOpen was triggered by an automatic reconnect (or pass it as an argument) and possibly if an onClose will trigger reconnection attempts in the future, which could be useful to display an "attempting to reconnect..." message to the user.
Another thing is that this issue doesn't seem to be similar to the AutobahnAndroid problem, since there a manual subscription in an onOpen triggered by an automatic reconnect doesn't seem to be working at all.
from autobahn-js.
I no longer think is worth / necessary ..
from autobahn-js.
Hi,
I'm finding this to be an issue in my application and can't think of any other way to go about it.
In a decently sized application you would expect the registration / subscriptions to be 'distributed' across multiple classes/components/controllers therefore not all re-registration can happen in the onopen method.
For our app we're storing the registrations/subscriptions in a AngularJS factory that also abstracts all controllers from Autobahn details. On reconnect we iterate through the stored registrations/subscriptions and re-register...this is something that can probably be done in an easier and cleaner way internally by autobahn using session.subscriptions and session.registrations. What do you think?
/Raffaele
from autobahn-js.
The session is destroyed when the connection is lost. Upon (automatic) reconnection, a new session object is created. I don't think scattering subscribe/register over classes is a good approach. But then, I don't know much about AngularJS. So I would need to have to look at a (larger) Angular/WAMP application to get a "feeling" for where the issues are. We have done large apps using AutobahnJS and Knockout, and there, we didn't have issues.
from autobahn-js.
Hi,
Ultimately I solved the maybe-Angular-specific-issue by using the following wrapper: https://github.com/voryx/angular-wamp . I leave it here in case anyone else has a similar problem
/Raffaele
from autobahn-js.
Related Issues (20)
- Subprotocol error when creating connection with [email protected] HOT 9
- Connections failed on SSL HOT 2
- Is there any way to send a blob? HOT 1
- autobahn.Error should contain the "details" parameter HOT 1
- Add a HarmonyOS-supported polyfill
- uncaught referenceerror: cr is not defined at <anonymous>:2:3
- Implement Payload Passthru Mode HOT 1
- Release 22.10.1 HOT 3
- autobahn js => es6 ? HOT 3
- cbor: problem sending payload larger than 16kb HOT 2
- Release v22.11.1
- Support latest ws 8.x
- Wrapping/unwrapping invocation results HOT 7
- How disconnect or close connection? HOT 1
- Subscribe does not fire when something is published
- Session detached after new session attached, resulting in `wamp.error.procedure_already_exists` HOT 5
- can you make a rpc call outside of onopen ? so you dont have to make parrallel connections everytime you want to make a call ?
- Support call cancelling via AbortController
- WebSocket connection to 'wss://site.com/socket/' failed
- Correct copyright holder HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autobahn-js.