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

swarmcore

v2.5.0

Published

Core library for creating swarm 2.0 systems .

Downloads

5

Readme

SwarmCore

Swarm 2.0 implementation of the SwarmESB (http://github.com/salboaie/SwarmESB) project. SwarmESB is a light ESB for node.js. SwarmCore includes core functionality for working with swarms version 2.0. Is a refactored version of the SwarmUtil module and will not need SwarmESB project. It depends on asynchron, apersistence and acl-magic modules.

Warning: This document is for advanced developers that are using SwarmESB. The real way of strating to learn SwarmESB is with http://github.com/salboaie/SwarmESB.!!!!

What is new

  1. Improved error handling:
  • "do" block: ensure that a phase is executed at least once
  • transaction blocks: mechanism to implement distributed transactions for swarms (not stable)
  • better monitoring and error handling (store data in redis)
  1. better semantic for swarm primitive
  • swarm is doing load distribution. You can nou launch many Adapters of the same type and they will balance the loading
  • broadcast primitive implementation to send swarm to all members of a group

Work in progress

  • implement long live processes using the swarm paradigm (equivalent in expressing workflow (BPM code) or rule engines)
  • UI to: display real time monitoring data, thresholds,etc
  • use swarms with docker. The plan is to create a very simple UI to launch and configure new docker containers executing swarms.

Warning: this is an experimental version. It is not yet ready for production if you are not a swarm core developer. For production code, you could use the old SwarmESB and SwarmUtil module (check branches).

SwarmCore will become a module in npm, but for now follow use the following install instructions:

Install for some small tests and quick play

1. get SwarmCore from GitHub
2. install Redis server
3. set SWARM_PATH folder to the SwarmCore directory
4. install all dependencies, go in SwarmCore folder and run: "npm install -g"
5. now you can launch adapters and the tests to get an impression about swarming

Install for creating real projects

1. get SwarmCore from GitHub
2. install redis
3. install all node.js dependencies with npm (run "node install -g" in the SwarmCore folder)
3. create a new project, with your source control. Set SWARM_PATH variable on this folder
4. create folders like etc, adapters, swarms in this new project
5. clone etc/config for your own folders and cases
6. create your new Adapters, tests, swarms
7. you should start adapters from SwarmCore (from etc/adapters ) like Core.js, DefaultLogger.js, PhaseMonitor.js

How to:

Create a new Swarm node (Adapter)

var core = require ("../../lib/SwarmCore.js");  //check your relative paths accordingly with your conventions
thisAdapter = core.createAdapter("Give_Me_A_Name");
/*  now add your functions and they could be called by executing swarms */

/*l
    Notice: The name yu gave is the name of a group of nodes doing similar tasks. "swarm" primitive is doing load distribution by implementation.
    You can start as many nodes in the same group and they will be used.
    For normal cases, load distribution is similar with load balancing as is trying to not overload already busy nodes
    and is doing something like Round Robin strategy when choosing nodes.
    For tasks that are not taking comparable amounts of time to execute, you could be in need to implement your own balancing strategies
*/

Create a new swarm file or a new folder with your swarms

Create a folder for swarms in your folder, copy one example and add your ctors and phases.
Don't forget to modify the etc/config to add in Core/path section your folder.

Launch multiple adapters

The Launcher adapter can be configured to launch multiple Adapters. When one adapter is crushing, the Launcher is restarting it automatically.