iproc

5.1.2 • Public • Published

Node module to simulate processes.

Usage:

var iproc=require("iproc");
var proc=iproc();

// create a process - pid returned
var pid=proc.create({
    exec:function(){
        /*code here*/
        self.onmessage=function(ev){
            // ev.data = message
            postMessage("/*message back to main process*/");
        };
    },
    autostart:(true|false),
    name:"process name",
    onmessage:function(ev){/*ev.data is the message*/}
});

// start a process via pid
proc.start(pid);

// stop an active process via pid
proc.stop(pid);

// stop and kill a process via pid
proc.destroy(pid);

// send message to process
proc.message(pid,message);

// get info on a pid
proc.info(pid);

// list active processes pids
proc.list();

Since last publish, I have completely reworked the system, not it only takes a function, (it can take a filepath if needed)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 5.1.2
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 5.1.2
    1
  • 1.0.1
    0

Package Sidebar

Install

npm i iproc

Weekly Downloads

1

Version

5.1.2

License

ISC

Last publish

Collaborators

  • cryogena