Topic

abstract class Topic<T>(val path: String, val isRetained: Boolean)

Defines a Topic which can be subscribed to and/or published to.

Parameters

path

Defines the path for the given topic. The path is a unique string across all topics. Think of it like the path of MQTT (just without the wildcard options).

isRetained

Whether this topic should be retained. If set to true, the latest item on the topic will always be cached (retained) and on new subscriptions to the topic, the latest, retained item will be emitted instantly.

Inheritors

Constructors

Link copied to clipboard
constructor(path: String, isRetained: Boolean)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
abstract fun deserialize(byteArray: ByteArray): T

De-Serializes the given byteArray into the type T.

Link copied to clipboard
abstract fun serialize(item: T): ByteArray

Serializes the given item into a ByteArray to be transmitted over the air.

Link copied to clipboard
open override fun toString(): String