SendReceive

Constructors

Link copied to clipboard
constructor(iBroker: MessageBroker<ByteString, ProtoMessageWrapper>, iManId: ProtoManId)

Конструктор на основе существующего брокера

constructor(manId: ProtoManId, id: String = "all")

Конструктор создаст брокер внутри класса

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
val manId: ProtoManId

Functions

Link copied to clipboard
fun awaitRequest(key: ByteString, message: ProtoMessageWrapper, timeoutMs: Long = DEFALT_AWAIT_TIMEOUT, needNum: Boolean = true): ProtoMessageWrapper
fun awaitRequest(topic: String, key: ByteString, message: ProtoMessageWrapper, timeoutMs: Long = DEFALT_AWAIT_TIMEOUT, needNum: Boolean = true): ProtoMessageWrapper

Отправить запрос и дождаться ответа в синхронном стиле

Link copied to clipboard
fun awaitRequestFragments(topic: String = gtwTopic, key: ByteString, message: ProtoMessageWrapper, timeoutMs: Long = DEFALT_AWAIT_TIMEOUT_FRAGMENTS): List<ProtoMessageWrapper>

Отправить запрос и собрать все пакеты-ответы в список. Работает с ProtoErrorCode.FRAGMENTED_* и собирает пакеты пока не придёт последний с FRAGMENTED_END.

Link copied to clipboard