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

bokeh

v1.0.3

Published

A blazing-fast task queue built on Node.js and ZeroMQ.

Downloads

59

Readme

Bokeh

Build Status

bokeh (pronounced boh-kay) is a simple, scalable and blazing-fast task queue built on Node.js and ZeroMQ. It allows you to offload tasks from your main application process and distribute them among a pool of workers. Workers can be running on the same host as your application, or scaled out onto multiple machines for greater processing power.

When you want a worker to run a task, just submit it to the broker using the client API. A task is simply any class in your application which responds to the run method.

Bokeh consists of three components:

  1. The client library which your application uses to submit tasks to the broker.
  2. The broker process which manages the pool of workers.
  3. The worker processes which are responsible for running tasks.

Installation

ZeroMQ

The only prerequisite is that you have ZeroMQ installed.

OS X

Install ZeroMQ using brew:

$ brew install zeromq

Ubuntu 10.04 LTS

Install ZeroMQ using Chris Lea's PPA:

$ sudo add-apt-repository ppa:chris-lea/zeromq
$ sudo apt-get update
$ sudo apt-get install libzmq-dbg libzmq-dev libzmq1

Bokeh

Install Bokeh using npm:

$ npm install bokeh

Overview

Task

A task is a class which responds to the run method. A task is dealt to a worker and executed.

Once the task has been completed, you must call the callback with any data you want to pass back to your application.

class Reverse
  run: (data, callback) -> callback null, data.split("").reverse().join("")

Client

The client is used by your application to submit tasks to the broker and monitor their progress.

bokeh = require "bokeh"
handle = bokeh.getClient().submitTask "Reverse", "hello world"
handle.on "complete", (data) -> console.log "Task %s completed: %s", handle.id, data
handle.on "error", (error) -> console.error "Task %s failed: %s", handle.id, error

Broker

The broker is responsible for routing messages from clients, persisting them to the data store and dealing them to workers.

bokeh = require "bokeh"
broker = new bokeh.Broker

Bokeh supports pluggable data stores for persisting tasks, currently in-memory, Redis and Riak are supported.

Worker

A worker is a process which receives tasks from a broker and executes them. You must register all your task classes with the worker.

bokeh = require "bokeh"
worker = new bokeh.Worker
worker.registerTask "Reverse", require("./tasks/reverse")

License

Bokeh is released under the MIT license.