Skip to content

Instantly share code, notes, and snippets.

@mindspank
Created June 8, 2015 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mindspank/d410e67953a62f305199 to your computer and use it in GitHub Desktop.
Save mindspank/d410e67953a62f305199 to your computer and use it in GitHub Desktop.
Multiple scoped connections with qsocks
var CORE = {
host: 'sense-demo.qlik.com',
isSecure: true,
appname: null
};
var APP1 = {
host: 'sense-demo.qlik.com',
isSecure: true,
appname: '5621cc5b-0bad-49d8-94c3-bef3aa5d8e84'
};
var APP2 = {
host: 'sense-demo.qlik.com',
isSecure: true,
appname: '45b5016e-6616-4047-aa5e-b6d70696634d'
};
//Global Transient Scope
qsocks.Connect(CORE).then(function(global) {
console.log('global',global)
})
//Scoped connection for App1
qsocks.Connect(APP1).then(function(global) {
global.openDoc(APP1.appname).then(function(app) {
app.getProperties().then(function(reply) {
console.log('APP1 ' + reply.qAppProperties.qTitle)
})
})
})
//Scoped connection for App2
qsocks.Connect(APP2).then(function(global) {
global.openDoc(APP2.appname).then(function(app) {
app.getProperties().then(function(reply) {
console.log('APP2 ' + reply.qAppProperties.qTitle)
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment