Comments (7)
Full reconnection is tricky business today, based on how Engine works (e.g. making sure existing APIs retrieved from enigma.js continue working etc.), we always imagined this being done outside of enigma.js but I definitely see the benefit of supporting seamless reconnection.
We do check if we're connected before trying to send messages (albeit a bit primitive): https://github.com/qlik-oss/enigma.js/blob/master/src/services/qix/rpc.js#L152
The trickiest thing is to reproduce the state in Engine, so one reconnection strategy could be that you have a proxy in front of Engine that would always keep the session (socket) to Engine open, and if the Client disconnects it'll keep it for a while and if the Client comes back the Client state should be valid enough to continue working against said Engine with a pretty small effort. This of course, only works as long as that proxy has a connection against the Engine. If that drops, the session as a whole wouldn't be able to reconnect.
from enigma.js.
Yeah, I'm just trying to wrap my head around how to approach it in the best way for a project.
How about websocket events, I can see they are emited in the code but they are not mentioned in the docs as far as I can see.
from enigma.js.
noob question, how does one force a websocket disconnection with enigma? Like I want to disconnect and then connect to a new app?
from enigma.js.
@goldbergjeffrey The best-practice here would be to not define appId
in your configuration to make sure your qix.global
and any opened apps are separate websockets. You can then do global.openDoc(appId)
to fetch an app, and app.session.close()
to disconnect. If you meant how to re-use websockets for new apps, that's not possible (not supported by QIX Engine).
from enigma.js.
@peol thank you for the advice. The way I'm writing my config I send in an appid, but it reads like that is not a good idea I'm better off terminating the web socket and creating a new one and doing open doc so that's what I'll do.
from enigma.js.
@goldbergjeffrey Yeah, I've written down that we should clarify "best-practices" for these use-cases.
Basically, if you will only work towards one app in your session, define appId
in your configuration, otherwise you're better off not defining it and use global.openDoc
.
from enigma.js.
We are currently looking into this in an internal issue, you'll see public-facing issues tracking a similar functionality soon.
from enigma.js.
Related Issues (20)
- Enigma js connection failed in new chrome browser HOT 11
- Error: Session suspended while connecting Qlik one environment but it is working other environment
- Remove/update link for schemas when API Insights is removed
- Unable to close app HOT 2
- Qlik Saas blocking websocket connections from origins not the tenant HOT 6
- Npm update - schema 12.936.0.json is missing HOT 1
- Remove dependency to after-work.js
- Failed to construct 'WebSocket': The subprotocol '[object Object]' is invalid. HOT 2
- Question: How can I get the sheet name by passing the sheet id HOT 1
- Question: How to connect to Qliksense Enterprise from the browser HOT 6
- flaky test `qix-logging` > `should log qix traffic`
- Incorrect Result for getHyperCubeData when using Master Measures in Viz Expressions HOT 8
- multiselect using enigma HOT 1
- Property 'openDoc' does not exist on type 'IGeneratedAPI HOT 5
- OnMaxParallelSessionsExceeded HOT 1
- upgrade to rollup v3
- Action Required: Fix Renovate Configuration
- TypeScript Support Broken HOT 2
- getDocList in Qlik Cloud instance HOT 2
- No use of providing appId to enigma session creation?
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 enigma.js.