Created
June 8, 2015 13:54
-
-
Save mindspank/d410e67953a62f305199 to your computer and use it in GitHub Desktop.
Multiple scoped connections with qsocks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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