Closed peterviergutz closed 4 years ago
Hey, this will be the first under 1 minute reaction time. :D
Looking into - will try to reproduce and come back.
Good issue writing. 👍
Ok, strange - I do see an error, but actually a different one:
$ node test.js
arr [ { error:
{ message:
'The "id" argument must be of type string. Received type object',
stack:
'TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received type object\n at validateString (internal/validators.js:125:11)\n at Module.require (internal/modules/cjs/lo
ader.js:687:3)\n at require (internal/modules/cjs/helpers.js:25:18)\n at msg.transforms.map (/Users/michal/src/scramjet-test/node_modules/scramjet/lib/stream-child.js:24:35)\n at Array.map (<anonymou
s>)\n at stream.pipe.JSONParse.shift (/Users/michal/src/scramjet-test/node_modules/scramjet/lib/stream-child.js:17:55)\n at process._tickCallback (internal/process/next_tick.js:68:7)' } },
{ error:
{ message:
'The "id" argument must be of type string. Received type object',
stack:
'TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received type object\n at validateString (internal/validators.js:125:11)\n at Module.require (internal/modules/cjs/lo
ader.js:687:3)\n at require (internal/modules/cjs/helpers.js:25:18)\n at msg.transforms.map (/Users/michal/src/scramjet-test/node_modules/scramjet/lib/stream-child.js:24:35)\n at Array.map (<anonymou
s>)\n at stream.pipe.JSONParse.shift (/Users/michal/src/scramjet-test/node_modules/scramjet/lib/stream-child.js:17:55)\n at process._tickCallback (internal/process/next_tick.js:68:7)' } },
{ error:
{ message:
'The "id" argument must be of type string. Received type object',
stack:
'TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received type object\n at validateString (internal/validators.js:125:11)\n at Module.require (internal/modules/cjs/lo
ader.js:687:3)\n at require (internal/modules/cjs/helpers.js:25:18)\n at msg.transforms.map (/Users/michal/src/scramjet-test/node_modules/scramjet/lib/stream-child.js:24:35)\n at Array.map (<anonymou
s>)\n at stream.pipe.JSONParse.shift (/Users/michal/src/scramjet-test/node_modules/scramjet/lib/stream-child.js:17:55)\n at process._tickCallback (internal/process/next_tick.js:68:7)' } },
{ error:
{ message:
'The "id" argument must be of type string. Received type object',
stack:
'TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received type object\n at validateString (internal/validators.js:125:11)\n at Module.require (internal/modules/cjs/lo
ader.js:687:3)\n at require (internal/modules/cjs/helpers.js:25:18)\n at msg.transforms.map (/Users/michal/src/scramjet-test/node_modules/scramjet/lib/stream-child.js:24:35)\n at Array.map (<anonymou
s>)\n at stream.pipe.JSONParse.shift (/Users/michal/src/scramjet-test/node_modules/scramjet/lib/stream-child.js:17:55)\n at process._tickCallback (internal/process/next_tick.js:68:7)' } },
{ error:
{ message:
'The "id" argument must be of type string. Received type object',
stack:
'TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received type object\n at validateString (internal/validators.js:125:11)\n at Module.require (internal/modules/cjs/lo
ader.js:687:3)\n at require (internal/modules/cjs/helpers.js:25:18)\n at msg.transforms.map (/Users/michal/src/scramjet-test/node_modules/scramjet/lib/stream-child.js:24:35)\n at Array.map (<anonymou
s>)\n at stream.pipe.JSONParse.shift (/Users/michal/src/scramjet-test/node_modules/scramjet/lib/stream-child.js:17:55)\n at process._tickCallback (internal/process/next_tick.js:68:7)' } },
{ error:
{ message:
'The "id" argument must be of type string. Received type object',
stack:
'TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received type object\n at validateString (internal/validators.js:125:11)\n at Module.require (internal/modules/cjs/lo
ader.js:687:3)\n at require (internal/modules/cjs/helpers.js:25:18)\n at msg.transforms.map (/Users/michal/src/scramjet-test/node_modules/scramjet/lib/stream-child.js:24:35)\n at Array.map (<anonymou
s>)\n at stream.pipe.JSONParse.shift (/Users/michal/src/scramjet-test/node_modules/scramjet/lib/stream-child.js:17:55)\n at process._tickCallback (internal/process/next_tick.js:68:7)' } },
{ error:
{ message:
'The "id" argument must be of type string. Received type object',
stack:
'TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received type object\n at validateString (internal/validators.js:125:11)\n at Module.require (internal/modules/cjs/lo
ader.js:687:3)\n at require (internal/modules/cjs/helpers.js:25:18)\n at msg.transforms.map (/Users/michal/src/scramjet-test/node_modules/scramjet/lib/stream-child.js:24:35)\n at Array.map (<anonymou
s>)\n at stream.pipe.JSONParse.shift (/Users/michal/src/scramjet-test/node_modules/scramjet/lib/stream-child.js:17:55)\n at process._tickCallback (internal/process/next_tick.js:68:7)' } },
{ error:
{ message:
'The "id" argument must be of type string. Received type object',
stack:
'TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received type object\n at validateString (internal/validators.js:125:11)\n at Module.require (internal/modules/cjs/lo
ader.js:687:3)\n at require (internal/modules/cjs/helpers.js:25:18)\n at msg.transforms.map (/Users/michal/src/scramjet-test/node_modules/scramjet/lib/stream-child.js:24:35)\n at Array.map (<anonymou
s>)\n at stream.pipe.JSONParse.shift (/Users/michal/src/scramjet-test/node_modules/scramjet/lib/stream-child.js:17:55)\n at process._tickCallback (internal/process/next_tick.js:68:7)' } } ]
Indeed Scramjet is not currently tested on Mac, since I have limited time to do that on my own infrastructure and I'm not aware of any free tools that would support macos tests...
Hi, I confirm this is an error on scramjet
end. I will investigate further and let you know here as soon as I'll find out what is the reason...
This doesn't work with any kind of child worker anymore.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Confirm I am also getting The "id" argument must be of type string. Received type object'
error on macos.
Update getting the same error on linux.
Realized this is an issue with how I am using the lib.
The api expects string pointing to file or npm package that gets included in a require statement here https://github.com/signicode/scramjet/blob/master/lib/stream-child.js#L24
@SeanAvery would you be able to attempt to fix this? There must be something wrong with the StreamWorker class when it passes the code to be run there.
I sadly don't have the throughput to fix this as I'm working on a major rewrite for v5
and at the same time trying not to suck at my day job. ;)
If you could create a repo that would show the problem then we could try to solve it together and I'd happily accept a fix PR.
@peterviergutz @SeanAvery can you check a one thing for me and just refactor the code from:
someDataStream.distribute(stream => something(stream))
to:
someDataStream
.separate(({x}) => "____" + x % 12)
.cluster(stream => something(stream))
This may cause some own issues, but let me know if the result is any different from this.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
First of all, thanks for this awesome library! I am very eager to test out hwich perfroamnce gains I can achieve using the distribute method, but somehow I cannot get it to run. Posting as a regular issue, because I am not sure if this is a bug or something wrong on my side.
I derived a small script from the testcase of the
distribute
method to test out any performance gains, but it keeps exiting on aproduces:
System:
Thanks for any pointer on how to solve this.