PacketConsumerUtil


@ExperimentalApi
object PacketConsumerUtil


Summary

Public functions

ListenableFuture<Void?>
<T : Any?> release(consumer: PacketConsumer<T>, executor: Executor)

Releases the PacketConsumer from Java by wrapping the suspend call in a ListenableFuture.

Public functions

release

fun <T : Any?> release(consumer: PacketConsumer<T>, executor: Executor): ListenableFuture<Void?>

Releases the PacketConsumer from Java by wrapping the suspend call in a ListenableFuture.

Parameters
consumer: PacketConsumer<T>

The PacketConsumer to release.

executor: Executor

The Executor to launch the coroutine on.

Returns
ListenableFuture<Void?>

A ListenableFuture that completes when the consumer has been released.