Class Cotani
java.lang.Object
com.cotani.Cotani
- All Implemented Interfaces:
AsyncCloseable, AutoCloseable
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Begins closing all registered resources without blocking the calling thread.Executes resource teardown asynchronously.deregister(AutoCloseable closeable) deregisterAsync(Supplier<CompletionStage<Void>> asyncCloseable) static Cotani.BuilderforPlugin(org.bukkit.plugin.Plugin plugin) org.bukkit.plugin.Pluginplugin()register(AutoCloseable closeable) registerAsync(Supplier<CompletionStage<Void>> asyncCloseable)
-
Method Details
-
forPlugin
-
plugin
public org.bukkit.plugin.Plugin plugin() -
register
-
deregister
-
registerAsync
-
deregisterAsync
-
closeAsync
Executes resource teardown asynchronously.First, all registered asynchronous teardown stages are executed concurrently. Once completed, synchronous closeables are executed in reverse registration order.
- Specified by:
closeAsyncin interfaceAsyncCloseable- Returns:
- a stage completing when all teardown steps finish
-
close
public void close()Begins closing all registered resources without blocking the calling thread.Use
closeAsync()when the caller needs to observe completion or failure.- Specified by:
closein interfaceAutoCloseable
-