import MsgFabric from 'msg-fabric-core'
const hub = MsgFabric.create(options)
id_route
-- route id for local target router; useful for tests and exploration.id_prefix
,id_suffix
-- configureshub.newRouteId()
to allow hierarchial named route ids.ms_interval=67
-- configures shared timer granularity. Defaults to 67, which is approximately 15 ticks per second.
timeouts
-- returns shared timer fromhub.router.timeouts
. See timeouts docsrouter
-- returnsFabricRouter
instance. See fabric router docslocal
-- default publishedTargetRouter
instance. Seehub.localRoute()
and router target docsloopback
-- alias forhub.router.loopback
send(...args)
-- alias forloopback.send(...args)
-
randId()
-
localRoute(id_route, is_private)
connects a newTargetRouter
. See router target docs -
Connections and Channels
connect(conn_url)
pluggable connection setup. See plugins for various implementations.connectUpstream(upstream_chan)
configures a channel as the default upstream for the fabric router.
-
Plugin support
-
livePlugin(... plugins)
-
plugin(... plugins)
-
registerProtocols(protocolList, cb_connect)
-- see plugins/web and plugins/net -
as_stream_codec()
andbind_codec()
-- see plugins/json and plugins/cbor
-