RecordingPacketConsumer


@ExperimentalApi
class RecordingPacketConsumer<T : Any?> : PacketConsumer


A PacketConsumer implementation that holds a reference to all queued packets, and optionally releases the underlying frames.

Summary

Public constructors

Public functions

open suspend Unit

Queues a Packet for processing, suspending the caller if the consumer is at capacity.

open suspend Unit

Releases all resources.

Public constructors

RecordingPacketConsumer

<T : Any?> RecordingPacketConsumer()

Public functions

queuePacket

open suspend fun queuePacket(packet: PacketConsumer.Packet<T>): Unit

Queues a Packet for processing, suspending the caller if the consumer is at capacity.

Once this method returns, the ownership of the packet is transferred to this PacketConsumer, and the caller should not modify the packet.

Parameters
packet: PacketConsumer.Packet<T>

The Packet to process.

release

open suspend fun release(): Unit

Releases all resources.

Public properties

onQueue

var onQueue: (T) -> Unit

queuedPackets

val queuedPacketsList<PacketConsumer.Packet<T>>

queuedPayloads

val queuedPayloadsList<T>