All Projects → flowhub → flowhub-registry

flowhub / flowhub-registry

Licence: other
Library for dealing with the Flowhub Runtime Registry

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to flowhub-registry

noflo-assembly
Industrial approach to writing NoFlo applications
Stars: ✭ 17 (+30.77%)
Mutual labels:  fbp
microflo-example-arduino
Quick start for MicroFlo on Arduino - clone and go!
Stars: ✭ 15 (+15.38%)
Mutual labels:  flowhub
FasterBrainfuckProgramming
This project is to make brainfuck language programming easier, faster and more powerful .. everything is made out of functions making it very easy to port to other languages
Stars: ✭ 19 (+46.15%)
Mutual labels:  fbp
Noflo
Flow-based programming for JavaScript
Stars: ✭ 3,202 (+24530.77%)
Mutual labels:  fbp
flowd
An inter-language runtime for flow-based programming (FBP)
Stars: ✭ 18 (+38.46%)
Mutual labels:  fbp

Flowhub Runtime Registry library

This library provides easy access to the Flowhub runtime registry. It is intended to be used by Flow-Based Programming Protocol compatible clients to register themselves available for Flowhub users.

Usage:

const flowhub = require('flowhub-registry');

// Prepare runtime information
const rt = new flowhub.Runtime({
  // Human-readable label for the runtime
  label: 'My home NoFlo system',
  // Unique identifier of the runtime instance (must be valid UUID)
  id: '754c5dc0-97e9-11e3-a5e2-0800200c9a66',
  // Flowhub user that should have access to the runtime (must be valid UUID)
  user: '89454800-97e9-11e3-a5e2-0800200c9a66',
  // Protocol to be used, eg. websocket, iframe, or webrtc
  protocol: 'websocket',
  // URL to the runtime
  address: 'ws://some.server.address:3569',
  // Type of the runtime, eg. noflo-nodejs or microflo
  type: 'noflo-nodejs',
  // Secret string for the user to utilize for communication (optional)
  secret: 'C6sxubeP22u4'
});

// Register the Runtime with Flowhub
rt.register(function (err, ok) {
  if (err) {
    alert('Registration failed');
  }
});

In addition to registering the runtime, it is a good idea to periodically ping Flowhub to let the user know that the runtime is still available.

setInterval(function () {
  rt.ping();
}, 5 * 60 * 1000);

If you have access to the user's OAuth token you can also remove a registered runtime:

rt.del('nch9138ohf2892fhgf92g8f942fh2938gf3', function (err, ok) {
});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].