PacketConsumerUtil


@ExperimentalApi
public static class PacketConsumerUtil

Summary

Public methods

static final @NonNull ListenableFuture<Void>
<T extends Object> release(
 @NonNull PacketConsumer<@NonNull T> consumer,
 @NonNull Executor executor
)

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

Public fields

INSTANCE

public static @NonNull PacketConsumerUtil INSTANCE

Public methods

release

public static final @NonNull ListenableFuture<Void> <T extends Object> release(
 @NonNull PacketConsumer<@NonNull T> consumer,
 @NonNull Executor executor
)

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

Parameters
@NonNull PacketConsumer<@NonNull T> consumer

The PacketConsumer to release.

@NonNull Executor executor

The Executor to launch the coroutine on.