Node.js interface to sysevent facilities on Illumos and related systems.
C++ C Python JavaScript D
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
demo
lib
src
support
test
README.md
package.json
wscript

README.md

NAME

node-sysevent - Node.js interface to sysevent

SYNOPSIS

var sysevent = require('sysevent');

sub.on('event', function (event) {
  console.log("Event received!");
  console.log("Class was " + event.class);
  console.log("Subclass was " + event.subclass);
  console.log("Publisher was " + event.pub);
  console.log("Publisher pid was " + event.pid);
  console.log("Publisher vendor was " + event.vendor);

  // stop watching for events
  sub.unsubscribe();
});

// watch for events
sub.subscribe("herp", "derp");

// post an event
sysevent.post("herp", "derp", "ovtech industries", process.argv[1]);

DESCRIPTION

sysevent is a low-level mechanism via which publishers and consumers can communicate within a machine. node-sysevent provides an asynchronous interface around the libsyevent library to access these facilities.

TODO

  • Allow user to specify a limited attrs object when post()ing an event. This will be converted into an nvlist_t object and passed to libsysevent.
  • If an attrs nvlist_t object is set on an incoming event, convert it to a javascript object and attach to the event object given on the event callback.
  • Allow user to specify more than one subclass when subscribing.
  • Crudely measured the syevent_subscribe_events call taking between 0.1 and 0.2 milliseconds to execute. Should punt into the libev threadpool.
  • Locking.

ENVIRONMENT

Should work whever libsysevent is installed and working, i.e. SmartOS, IllumOS, OpenSolaris, and Solaris. Let me know. ;-)

BUGS

Warning: some things are not quite implemented yet so use at your own risk.

AKNOWLEDGEMENTS

AUTHOR

Orlando Vazquez < ovazquez@gmail.com >