0.0.1 • Published 5 years ago

internal-msg-bus v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

Msg

A tiny internal messaging bus

version 0.0.1

Enum State

Possible States

FAILPENDSTAT
-101

Interface bus

statstepmaxid
the bus statecurrent stepmaximum stepsbus id

Class msg

Properties

bus
private

Methods

msg.id
msg.id() // Returns bus ID
msg.statState
msg.stat() // returns bus status, -1 | 0 | 1
msg.fail
msg.fail() // Set state to -1 to indicate failure
msg.succ
msg.succ() // Set state to 1 to indicate failure

msg.reset

msg.reset(id, mx?)

Reset msg state to pending, change ID to id and maximum steps to mx if provided. if mx is not provided, it will be set to 0.

argtypedescrption
idnumber requirednew ID
mxnumber optionalmaximum steps
msg.step
msg.step()

increments bus step, sets bus status to -1 if the new count is greater than the maximum allowed number of steps.