[nodejs] How to start a child process and add arguments to node.exe?

2014-05-11 Thread ami
I am trying to run child node using --stack-trace-limit=1000 child_process.fork('file.js',[' --stack-trace-limit=1000']) Is it will work? I believe not, because the args, is for the child_process not for the node.exe. Anyone knows? -- Job board: http://jobs.nodejs.org/ New group rules:

Re: [nodejs] This is a way to check the active domain in node?

2014-03-07 Thread ami
Rajlich wrote: Did you read the docs for domain.enter()[0]? It states that it sets `process.domain` to the active domain when called. [0]: http://nodejs.org/api/domain.html#domain_domain_enter On Thu, Mar 6, 2014 at 3:25 AM, ami amin...@gmail.com javascript:wrote: Some think like

[nodejs] This is a way to check the active domain in node?

2014-03-06 Thread ami
Some think like: process.domain I want to do. in main.js var x=domain.create(); in a moudle. process.domain.on('error') of process.domain.trigger But I don't know the active domain. http://nodejs.org/api/domain.html -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

[nodejs] Keeps the rest of the handlers from being executed

2014-02-25 Thread ami
req=request() req.on('complete',a) req.on('complete',b) *function a()*{ console.log('a') *return false* } function b(){ console.log('I dont want this function to be executed') } I want to change *function a*, that function b will never execute. In other words, for example I tries:

[nodejs] Make function to wait until last execute end.

2014-02-12 Thread ami
I would like to write a function that cannot run two times in the same time. If someone try to execute it twice (or more), it will wait. For example, myFunc writing to DB, I don't want too much writing on the same time. *myFunc.js:* module.exports.myFunc= function() { // Do some heavy CPU }

[nodejs] Get the error text in error callback

2014-02-09 Thread ami
*this is my error object, in the error callback:* d1=domain('create') d1.on('error',function (e){ console.log(e) } d1.run(function () {cons()}) { [ReferenceError: cons is not defined] domain: { domain: null, _events: { error: [Function] }, _maxListeners: 10, members: [] },

[nodejs] Auto restart server when cannot connect

2014-02-09 Thread ami
I am using node-supervisor / node-forever / nodemon to auto restart node server on crash or when changing files. But sometimes the server stop working and cannot receive connection I don't know way. I am searching for node module that works in the background, and will restart the server if it

[nodejs] Is it optional to add the err argument to callbacks?

2014-02-06 Thread ami
Must of async' function of nodejs get a callback with first parameter is err. *like:* request('',callback) fs.readFile('',callback) express.get(callback) *Do I must to add the err argument?* *can I use this function:* function mycallback(data){ } *Instead of:* function mycallback(err,