Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/131/ubk

micro message broker for nodejs
https://github.com/131/ubk

broker json-stream

Last synced: about 2 months ago
JSON representation

micro message broker for nodejs

Awesome Lists containing this project

README

        

# ubk
High performance, micro [JSON streaming](https://en.wikipedia.org/wiki/JSON_Streaming) message broker for v8.
[ubk](https://github.com/131/ubk) use ES8 async/await design (backed on [co/eventemitter-co](https://github.com/131/eventemitter-co)

[![Build Status](https://github.com/131/ubk/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/131/ubk/actions/workflows/test.yml)
[![Coverage Status](https://coveralls.io/repos/github/131/ubk/badge.svg?branch=master)](https://coveralls.io/github/131/ubk?branch=master)
[![Version](https://img.shields.io/npm/v/ubk.svg)](https://www.npmjs.com/package/ubk)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)
[![Code style](https://img.shields.io/badge/code%2fstyle-ivs-green.svg)](https://www.npmjs.com/package/eslint-plugin-ivs)

# Key features
* Exupery style. (You will not make it any smaller or simplier)
* Broker support application (backend)
* pub/sub pattern
* RCP support (asynchronious procedure calls)
* Reflection API (list connected clients)

## Server API
* Server implement EventEmitter API.
`.register_cmd(ns, command, callback)`
subscribe for a specific message in NS, callback is callback(client, query)

`.broadcast(ns, cmd, payload)`
* send a payload message to all connected clients
* emit local event "ns:cmd"

### Events
Broadcast messages are forwarded into the EventEmitter dispatcher
* "base:registered_client"
* "base:unregistered_client"

### Base (internal) messages
"base:ping" , send periodicaly to all client to check for a living connection
*payload : none
"base:registered_client", broadcasted to all client on new client registration
*payload : client
"base:unregistered_client", broadcasted to all clients on client disconnection
*payload : client