Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

[domain] [feat-req] domain.run function with parameters #7193

Closed
micnic opened this issue Feb 26, 2014 · 1 comment
Closed

[domain] [feat-req] domain.run function with parameters #7193

micnic opened this issue Feb 26, 2014 · 1 comment
Labels

Comments

@micnic
Copy link

micnic commented Feb 26, 2014

It would be great to be able to define the parameters for the function that is called inside the domain.run(fn) method.

I propose this API change:
domain.run(fn, [arg1], [arg2], [...])

An example of use:

function justDoSomething(a, b, c) {
    /* do something else */
    return a + b + c;
}

mathDomain.run(justDoSomething, 1, 2, 3);

This approach would allow to use values from the current context and run a function that is outside of this context as it is implemented in setTimeout() or setInterval().

@brendanashworth
Copy link

This was implemented in nodejs/node#15, and won't be backported to v0.x, so I'll close this.

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

No branches or pull requests

2 participants