-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
WIP: Node WorkerChannel native addon #1394
base: v3
Are you sure you want to change the base?
Conversation
Substitute spawning a process with mediasoup for running mediasoup in a thread created by this addon. The communication is now done via message passing rather than using unixsocket, avoiding the kernel networking stack for each and every message passed from Node to C++ and viceversa. Performance gains are enhanced by approximately 8 times. Tested by sending a request from Node to C++ and waiting for the response N times in a loop.
.gitignore
Outdated
## Node WorkerChannel addon. | ||
/node/workerChannel/node_modules | ||
/node/workerChannel/build | ||
/node/workerChannel/lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we include this lib
folder in "files" in main package.json
? Or should it be managed by the package.json
of the addon folder? What I mean is that:
- We only include JS transpiled files in the mediasoup NPM package and not TS files (AKA
node/src
folder). - Is the addon properly built if we install mediasoup as a git+ssh dependency in the package.json of whatever app using mediasoup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done and tested. package.json files
are properly edited. adding mediasoup as a git+ssh dependency of a 3rd party app has also been tested.
|
Please merge v3 and check prettier and eslint path arrays in npm-scripts.mjs |
This reverts commit 4237fc2.
Node will clean the native addon once it garbage collects the corresponding JS instance.
assign JS instance of the addon to 'undefined' when closed, to indicate the Node GC that it can be freed. Otherwise the tests won't finish due to the correponsing handles being opened.
Lower npm versions than 10.3.0 fail building the addon. Error: No module named 'distutils'
Substitute spawning a process with mediasoup for running mediasoup in a thread created by this addon.
The communication is now done via message passing rather than using unixsocket, avoiding the kernel networking stack for each and every message passed from Node to C++ and viceversa.
Performance gains are enhanced by approximately 8 times. Tested by sending a request from Node to C++ and waiting for the response N times in a loop.
Caveats:
TODO: