Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The process never exits. #38

Open
rezaalavi opened this issue Jul 10, 2016 · 1 comment
Open

The process never exits. #38

rezaalavi opened this issue Jul 10, 2016 · 1 comment

Comments

@rezaalavi
Copy link

rezaalavi commented Jul 10, 2016

Hi,

I am having this issue with jailed under node that the process never exist therefore onDisconnect never gets called.
This happens even with the sample code provided on github.

Here the code that I used:

var jailed = require('jailed' )
var code = `
    var api = {
        square: function(num, cb) {  
            cb(num*num);
        }
    }
    application.setInterface(api);
`

var plugin = new jailed.DynamicPlugin(code);
var start = function() {

    plugin.remote.square(2, reportResult);
}
var reportResult = function(result) {
    console.log("Result is: " + result);  
}
plugin.whenConnected(start);

Executing the above under node never exist and only shows "Result is: 4"

@asvd
Copy link
Owner

asvd commented Jul 11, 2016

The plugin is designed to be used multiple times and does not shut down by itself. You should explicitly disconnect it using the disconnect() method either form the application, or from inside the plugin.

Let me know if you think that this behaviour can be redone in a more convenient way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants