0.2.0 • Published 7 years ago

micro-panda-transporter-nats v0.2.0

Weekly downloads
10
License
-
Repository
-
Last release
7 years ago

NATS Transporter

API

constructor

params:

  • errorHandler - func(err)
  • timeout - default to 1 minute. if a method call does not receive any response for such a time, it fails.

define

define a method.

params:

  • name
  • handler - async func(input) => output

async call

call a method. should be called after started.

params:

  • name
  • input

returns

  • output

on

listen to events.

params:

  • name
  • group
  • handler - async func(input)

emit

emit event. should be called after started.

params:

  • name
  • input

async start

start the transporter.

params:

async stop

stop the transporter.