Reading data
Channels & subscriptions
Current version · 2.0.0
latest() returns an optional snapshot; next() returns a one-shot asynchronous result. publisher() is hot: samples without demand are dropped and later demand does not replay them. Configuration applies to new subscriptions, not snapshots or one-shot reads.
ReadChannel
com.qnbot.sdk.channel.ReadChannel
ReadChannel.withConfig
ReadChannel<T> withConfig(SubscriptionConfig config)
ReadChannel.latest
Optional<Sample<T>> latest()
ReadChannel.subscribe
Subscription subscribe(Consumer<Sample<T>> callback)
ReadChannel.publisher
Flow.Publisher<Sample<T>> publisher()
ReadChannel.next
CompletionStage<Sample<T>> next()
StateChannel
com.qnbot.sdk.channel.StateChannel
StateChannel.withConfig
StateChannel<T> withConfig(SubscriptionConfig config)
StateChannel.set
void set(T value)
StateChannel.clear
void clear()
Sample
com.qnbot.sdk.channel.Sample
| Field / enum value |
|---|
final T value |
final long sequence |
final Double sourceTime |
final double observedAt |
Subscription
com.qnbot.sdk.channel.Subscription
Subscription.unsubscribe
void unsubscribe()