New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tubejs

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tubejs

asynchronous Concurrent messaging

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

Tube JS (v 0.0.1)

A prototype port of Scala actors to NodeJS. A lightweight asynchronous concurrent messaging.

Before we begin this project you shall be aware as this project is still in its prototype version and unstable. Future releases will make this library ready to be used in a production manner.

Getting Started

Example:

var tubeJs = require('tubeJs');
var channel = new tubeJs();

channel.spawn("actor1", "/absolute/path/to/actor/module");
channel.spawn("actor2", require.resolve("./relative/path/yourActor.js"));

At yourActor.js:

module.exports = function(wractor, name, path) {
	console.log("CPID: "+ process.pid);
	console.log("Actor name & Path: ", name, path);

	wractor.on("message", function(sender, message, type) {
		console.log("Actor Received: ", sender, message, type);
		wractor.send(sender, message);
	});
	wractor.on("request", function(sender, message, type) {
		console.log("Actor is requested: ", sender, message, type);
		wractor.send(sender, message);
	});
}

Send messages from Master to an actor:

channel.of("actor1").send("master", "Hello World", function () {
	console.log("Sent!");
});

Then actor1 will receive "Hello World" as message.

Feel free to enjoy.

Cheers!

Keywords

tubeJS

FAQs

Package last updated on 13 May 2013

Did you know?

Socket

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.

Install

Related posts