Skip to main content

Class: TopicRouter


PURISTA API / Modules / @purista/mqttbridge / TopicRouter

Class: TopicRouter

@purista/mqttbridge.TopicRouter

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new TopicRouter(logger?): TopicRouter

Parameters

NameType
logger?Logger

Returns

TopicRouter

Defined in

mqttbridge/src/topic/TopicRouter.ts:12open in new window

Properties

counter

counter: number = 1

Defined in

mqttbridge/src/topic/TopicRouter.ts:10open in new window


logger

logger: Logger

Defined in

mqttbridge/src/topic/TopicRouter.ts:8open in new window


routes

routes: Map<number, { fn: IncomingMessageFunction ; topic: string }>

Defined in

mqttbridge/src/topic/TopicRouter.ts:7open in new window

Methods

add

add(topic, fn): number

Parameters

NameType
topicstring
fnIncomingMessageFunction

Returns

number

Defined in

mqttbridge/src/topic/TopicRouter.ts:17open in new window


match

match(topic, id?): IncomingMessageFunction[]

Parameters

NameType
topicstring
id?number

Returns

IncomingMessageFunction[]

Defined in

mqttbridge/src/topic/TopicRouter.ts:31open in new window


remove

remove(topic): void

Parameters

NameType
topicstring | number

Returns

void

Defined in

mqttbridge/src/topic/TopicRouter.ts:25open in new window

Last update:
Contributors: Sebastian Wessel