Package io.aether.net.fastMeta.nio
Class NioFastMetaNet
java.lang.Object
io.aether.net.fastMeta.nio.NioFastMetaNet
- All Implemented Interfaces:
io.aether.net.fastMeta.FastMetaNet,AutoCloseable
public class NioFastMetaNet
extends Object
implements io.aether.net.fastMeta.FastMetaNet, AutoCloseable
NIO-based implementation of the FastMetaNet factory.
This class creates and manages non-blocking clients and servers.
It runs a central I/O event loop (Reactor) in a dedicated thread
and uses a Destroyer to manage all created resources.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.aether.net.fastMeta.FastMetaNet
io.aether.net.fastMeta.FastMetaNet.Connection<LT,RT extends io.aether.net.fastMeta.RemoteApi>, io.aether.net.fastMeta.FastMetaNet.WritableConsumer -
Field Summary
Fields inherited from interface io.aether.net.fastMeta.FastMetaNet
INSTANCE -
Constructor Summary
ConstructorsConstructorDescriptionInitializes the NioFastMetaNet and starts the underlying I/O reactor thread. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Shuts down the NIO reactor thread and all created clients/servers.<LT,RT extends io.aether.net.fastMeta.RemoteApi>
io.aether.net.fastMeta.FastMetaClient<LT, RT> makeClient(URI uri, io.aether.net.fastMeta.FastMetaApi<LT, ?> lt, io.aether.net.fastMeta.FastMetaApi<?, RT> rt, io.aether.utils.interfaces.AFunction<RT, LT> localApi, io.aether.net.fastMeta.FastMetaNet.WritableConsumer writableConsumer) <LT,RT extends io.aether.net.fastMeta.RemoteApi>
io.aether.net.fastMeta.FastMetaServer<LT, RT> makeServer(URI uri, io.aether.net.fastMeta.FastMetaApi<LT, ?> localApiMeta, io.aether.net.fastMeta.FastMetaApi<?, RT> remoteApiMeta, io.aether.net.fastMeta.FastMetaServer.Handler<LT, RT> handler)
-
Constructor Details
-
NioFastMetaNet
public NioFastMetaNet()Initializes the NioFastMetaNet and starts the underlying I/O reactor thread.
-
-
Method Details
-
close
public void close()Shuts down the NIO reactor thread and all created clients/servers.- Specified by:
closein interfaceAutoCloseable
-
makeClient
public <LT,RT extends io.aether.net.fastMeta.RemoteApi> io.aether.net.fastMeta.FastMetaClient<LT,RT> makeClient(URI uri, io.aether.net.fastMeta.FastMetaApi<LT, ?> lt, io.aether.net.fastMeta.FastMetaApi<?, RT> rt, io.aether.utils.interfaces.AFunction<RT, LT> localApi, io.aether.net.fastMeta.FastMetaNet.WritableConsumer writableConsumer) - Specified by:
makeClientin interfaceio.aether.net.fastMeta.FastMetaNet
-
makeServer
public <LT,RT extends io.aether.net.fastMeta.RemoteApi> io.aether.net.fastMeta.FastMetaServer<LT,RT> makeServer(URI uri, io.aether.net.fastMeta.FastMetaApi<LT, ?> localApiMeta, io.aether.net.fastMeta.FastMetaApi<?, RT> remoteApiMeta, io.aether.net.fastMeta.FastMetaServer.Handler<LT, RT> handler) - Specified by:
makeServerin interfaceio.aether.net.fastMeta.FastMetaNet
-