Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
enchannel-socketio-backend
Advanced tools
enchannel powered by socket.io, to be used with kernel-relay
:electric_plug: enchannel powered by socket.io, designed to be used with kernel-relay.
npm install enchannel-socketio-backend
Enchannel-socketio-backend provides an API for spawning, disconnecting, and shutting down remote kernels in addition to implementing the enchannel spec. A typical use would be to spawn a kernel, connect to the kernel and communicate using enchannel and Jupyter message specs, disconnect from the kernel, and optionally shut it down.
The act of connecting and disconnecting is deliberately separate to the act of spawning and shutting down a kernel. This allows one to spawn a kernel, start some compute on it, disconnect and reconnect at a later time, and shutdown the kernel when appropriate.
To use the enchannel-socketio-backend, you must have access to a running kernel-relay server.
Spawns a remote kernel by name. Takes two arguments:
Returns a promise with the kernel id, string.
spawn(endpoint, kernelName)
Usage example
const enchannelBackend = require('enchannel-socketio-backend');
enchannelBackend.spawn('http://localhost:3000/', 'python3').then(id => {
console.log('spawned', id);
}).catch(err => {
console.error('Could not spawn the kernel', err);
});
Connects to a remote kernel by id. Accepts two arguments:
Returns a promise for an enchannel spec channels object
connect(endpoint, kernelId)
Usage example
enchannelBackend.connect('http://localhost:3000/', id).then(channels => {
console.log('connected', channels);
}).catch(err => {
console.error('Could not connect to the kernel', err);
});
For API usage of the enchannel channels
object, refer to the enchannel spec README.
Shuts down a remote kernel by id. Accepts two arguments:
Returns a promise which resolves when the shutdown is complete.
shutdown(endpoint, kernelId)
Usage example
enchannelBackend.shutdown('http://localhost:3000/', id).then(() => {
console.log('shutdown');
}).catch(err => {
console.error('Could not shutdown the kernel', err);
});
Disconnects from a kernel by closing the channels. Accepts one argument, the enchannel channels object.
Returns promise which resolves on success.
disconnect(channels)
Usage example
enchannelBackend.disconnect(channels).then(() => {
console.log('disconnected');
}).catch(err => {
console.error('Could not close the channels', err);
});
To develop against enchannel-socketio-backend, first clone the repo then from within the cloned folder run:
npm install
npm link
Before opening a pull request, please run the unit tests locally:
npm test
FAQs
enchannel powered by socket.io, to be used with kernel-relay
We found that enchannel-socketio-backend demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.