do remember that you start a new client on the server, so it wont have the same state as you now have in your client (it is not just a new thread in your current client)
a quick demo code:
var client = null;
/**
* @properties={typeid:24,uuid:"BAD1AEE9-9B72-477A-A0AA-10619F4C2127"}
*/
function headlessTest()
{
client = plugins.headlessclient.createClient(solutionName,username,password,solutionOpenMethodArgs)
client.queueMethod(null,globalmethodnameinremotesolution,args,callbackFunction)
}
/**
* @param {JSEvent} event
*/
function callbackFunction(event)
{
// do some stuff
if (JSClient.CALLBACK_EVENT == event.getType())
{
// handle normal execute of remote method
}
else if (JSClient.CALLBACK_EXCEPTION_EVENT == event.getType())
{
// handle exception execute of remote method
}
client.shutdown()
}
I was thinking I could use it as a new thread - but running the process on the server is way more powerful.
Forgive my ignorance - but using this plugin means a headless client is started on the server - but unlike running a HLC from a scheduler, there must be a solution open at the time to initiate it?
When I try to use the headless client plugin in Servoy 5.1.2, I get Can’t find method com.servoy.extensions.plugins.headlessclient.HeadlessClientProvider.js_createClient(string,string,string,string)
on