subscribeTopic

@CheckReturnValue
abstract override fun <T> subscribeTopic(topic: TopicOut<T>): Observable<T>

Subscribes to a given topic.

Note that you need to use a SOContext which includes the given topic in order to be able to subscribe to the given topic here. If the context required for subscribing the given topic is not currently in use, the returned Observable will emit a ContextNotInUseException error.

The returned Observable will be disposed when the corresponding SOContext is released.

Scheduler: The returned Observable will operate on the IO Scheduler.

Return

an Observable which emits the payload of the items emitted from the remote device on the given topic as ByteArray, or a ContextNotInUseException if there is currently no context in use which contains the given topic within its SOContext.outTopics.

Parameters

topic

the topic to subscribe to. This needs to be a TopicOut, so a topic which is defined to be used as an output from the remote device.

See also