Class FutureListeners
java.lang.Object
net.fabricmc.fabric.api.networking.v1.FutureListeners
Utilities for working with netty's future listeners.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic ChannelFutureListener
free
(PacketByteBuf buf) Returns a future listener that releases a packet byte buf when the buffer has been sent to a remote connection.static boolean
isLocalChannel
(Channel channel) Returns whether a netty channel performs local transportation, or if the message objects in the channel are directly passed than written to and read from a byte buf.static <A extends Future<? super Void>,
B extends Future<? super Void>>
GenericFutureListener<? extends Future<? super Void>>union
(GenericFutureListener<A> first, GenericFutureListener<B> second) Combines two future listeners.
-
Method Details
-
free
Returns a future listener that releases a packet byte buf when the buffer has been sent to a remote connection.- Parameters:
buf
- the buffer- Returns:
- the future listener
-
isLocalChannel
Returns whether a netty channel performs local transportation, or if the message objects in the channel are directly passed than written to and read from a byte buf.- Parameters:
channel
- the channel to check- Returns:
- whether the channel is local
-
union
public static <A extends Future<? super Void>,B extends Future<? super Void>> GenericFutureListener<? extends Future<? super Void>> union(GenericFutureListener<A> first, GenericFutureListener<B> second) Combines two future listeners.- Type Parameters:
A
- the future type of the first listener, used for castingB
- the future type of the second listener, used for casting- Parameters:
first
- the first future listenersecond
- the second future listener- Returns:
- the combined future listener.
-