0.1.0 • Published 5 years ago

chanjs-client v0.1.0

Weekly downloads
3
License
ISC
Repository
-
Last release
5 years ago

Channel client JS

Javascript library for async data flow implementation for browsers.

How to use

you need to have a running instances of async-dataflow-channel-sender

Install

npm install chanjs-client --save

AsyncClient basic usage example

You can understand better the flow with this sequence diagram.

import { AsyncClient } from 'chanjs-client';

...
const client = new AsyncClient({
    socket_url: "wss://some.domain:8984/socket",
    channel_ref: "some_channel_ref",
    channel_secret: "secret_from_some_auth_service",
    heartbeat_interval: 200
});
...
ParametersDescriptionDefault Value
socket_urlasync-dataflow-channel-sender cluster url
channel_refchannel getted from rest service of async-dataflow-channel-sender
channel_secrettoken getted from rest service of async-dataflow-channel-sender
heartbeat_intervaltime in milliseconds to verify socket connection this parameter must be less than the socket_idle_timeout on the channel sender750
enable_binary_transportboolean parameter to indicate use binary protocolfalse
client.listenEvent("event.some-name", message => someCallback(message.payload));

How can I help?

Review the issues. Read how Contributing.

0.1.0

5 years ago