npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-cspread

v0.1.1

Published

C++ addon to interface to spread using the C API

Downloads

4

Readme

NODE-CSPREAD

Overview:

 This is a C++ addon to nodejs to interface with the spread C API to provide

a high performance binding to the spread toolkit (see www.spread.org). It contains a thin abstraction called SpreadSession which provides an event based interface where the end user supplies a set of callbacks to handle various events.

Build & Install:

 You must first have the spread toolkit built and installed. The binding.gpy expects the

spread to be installed in the /usr/local/lib directory. Next you can build the addon by doing:

cd node-cspread node-gyp build sudo node-gyp install

Examples:

See the unittest function in spread.js as a usage example.

API:

SpreadSession( daemon_address /* 4803@localhost*/, uniqueName /* system wide unique name like a UUID /, success / callback function executed when connected /, failure / called if we can't connect */ );

If successful in connecting to the spread daemon, the success function above is called with an instance of a spread session object. Inside this function the user can join message groups and setup callbacks to handle events:

Example:

function success( session ) { session.join( “group name” ); session.dataHandler = function( group, sender, data ){

       console.log( group + "," + sender + "," + data );
 };
 session.memberJoinedGroup =  function( group, sender ) {
       // detect when a new process has join a group
       // group: name of the spread group 
       // sender: process uniqueName 
 };
 session.memberLeftGroup = function( group, sender ) {
       // detect when a member has left a message group
 };
 
 // these are error conditions
 session.leaveCausedByNetwork = function( group, sender ) {
      // network outage caused a member to leave
 };
 session.leaveCausedByDisconnect = function( group, sender ) {
      // process lost connection to spread (process crash message).
 };
 session.onDisconnect = function( errorText ) {
      // we just lost our connection to spread.
 };   
 session.onError = function( errorText ) {
      // general error event
 };



 // to send a message to other groups
 session.multicast( session.SAFE_MESS, session.SELF_DISCARD,
      “group name”,  JSON.stringify( … some data … ) );

};