You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nodejs should support marshalling closures between two different node instances. You can imagine this being used by a jobs library.
var from = "user@nodejs.org";
var to = "featurerequest@nodejs.org"
...
job.post(function() {
emailService.send(from, to, {subject: "Feature request - marshal closures", body: "Nodejs should support marshalling closures for distributed computing"});
});
In this example to and from should be marshalled with the closure. The result could be read into another nodejs instance and executed to send an email. This technique is used extensively with jenkins to send work from the master instance to the slave instance.
As demonstrated by the sample code there is a technical question. How would you handle emailService? Does it get marshalled? How do you refer to a component that is on the target and not on the source? Would there be a need to mark things so that they are not marshalled?
For example the code could be changed to:
var from = "user@nodejs.org";
var to = "featurerequest@nodejs.org"
...
job.post(function() {
require(emailService).send(from, to, {subject: "Feature request - marshal closures", body: "Nodejs should support marshalling closures for distributed computing"});
});
Would the require function not get marshalled, would the result of the require call return the target's email service?
The text was updated successfully, but these errors were encountered:
What you propose seems very hard to implement (if not impossible) and not worth it. You can achieve the same result by having a global registry of jobs and passing parameters as json.
nodejs should support marshalling closures between two different node instances. You can imagine this being used by a jobs library.
In this example to and from should be marshalled with the closure. The result could be read into another nodejs instance and executed to send an email. This technique is used extensively with jenkins to send work from the master instance to the slave instance.
As demonstrated by the sample code there is a technical question. How would you handle emailService? Does it get marshalled? How do you refer to a component that is on the target and not on the source? Would there be a need to mark things so that they are not marshalled?
For example the code could be changed to:
Would the require function not get marshalled, would the result of the require call return the target's email service?
The text was updated successfully, but these errors were encountered: