Push

class Push(channel: Channel, event: String, payload: Payload, timeout: Long, scope: CoroutineScope) : SharedFlow<Message>

A Push represents an attempt to send a payload through a Channel for a specific event.

Constructors

Link copied to clipboard
fun Push(channel: Channel, event: String, payload: Payload = emptyMap(), timeout: Long = Defaults.TIMEOUT, scope: CoroutineScope)

Functions

Link copied to clipboard
open suspend override fun collect(collector: FlowCollector<Message>): Nothing
Link copied to clipboard
suspend fun emit(value: Message)
Link copied to clipboard
suspend fun resend(timeout: Long = Defaults.TIMEOUT)

Resets and sends the Push

Link copied to clipboard
suspend fun send()

Sends the Push. If it has already timed out then the call will be ignored. use resend(timeout:) in this case.

Properties

Link copied to clipboard
val channel: Channel

The channel the Push is being sent through

Link copied to clipboard
val event: String

The event the Push is targeting

Link copied to clipboard
var payload: Payload

The message to be sent

Link copied to clipboard
open override val replayCache: List<Message>
Link copied to clipboard
var timeout: Long

Duration before the message is considered timed out and failed to send