Endless script execution

Dec 5, 2015 at 4:03 PM
Edited Dec 5, 2015 at 5:19 PM
Is there any way to make endless script execution?
I have script where I set up event handler for browser that should load page but script ends earlier. Is there any way to force script wait, but not exit?
. . .
var connection = browser.Awesomium.LoadingFrameComplete.connect(function(s, a) {
    Logger.Print('Called successfully!');

browser.Awesomium.Source = new Uri('https://google.com'); // connection callback should be fired when this operation will be completed.
After this preparations script execution ends and callback will be never called.

Thanks in advance!
Dec 6, 2015 at 7:57 PM
Hi aki4,

There's no reason to keep the script engine active. In fact, depending on your threading architecture, doing so could create a deadlock between it and the event source. Instead, simply keep the script engine alive as long as it's connected to the event source; that is, don't dispose it until after it disconnects.

Good luck!