Class TachyonEventBusImpl
java.lang.Object
tech.skworks.tachyon.plugin.core.event.TachyonEventBusImpl
- All Implemented Interfaces:
EventBus<org.bukkit.plugin.java.JavaPlugin>
public class TachyonEventBusImpl
extends Object
implements EventBus<org.bukkit.plugin.java.JavaPlugin>
Core implementation of the Tachyon Event Bus.
Uses lock-free collections for instantaneous read operations and a ForkJoinPool
for high-performance, work-stealing asynchronous dispatching. Listeners are bound to their respective
JavaPlugin to allow seamless unregistration upon plugin disable.
Project Tachyon
- Since:
- 1.0.0-SNAPSHOT
- Version:
- 1.0
- Author:
- Jimmy (vSKAH) - 20/05/2026
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends TachyonEvent>
voidpost(T event) <T extends TachyonEvent>
voidregister(@NotNull org.bukkit.plugin.java.JavaPlugin owner, @NotNull Class<T> eventClass, @NotNull Consumer<T> handler) voidshutdown()Cleanly shuts down the event bus and its underlying thread pool.<T extends TachyonEvent>
voidunregister(@NotNull org.bukkit.plugin.java.JavaPlugin owner, @NotNull Class<T> eventClass, @NotNull Consumer<T> handler) voidunregisterAll(@NotNull org.bukkit.plugin.java.JavaPlugin owner)
-
Constructor Details
-
TachyonEventBusImpl
public TachyonEventBusImpl()
-
-
Method Details
-
register
public <T extends TachyonEvent> void register(@NotNull @NotNull org.bukkit.plugin.java.JavaPlugin owner, @NotNull @NotNull Class<T> eventClass, @NotNull @NotNull Consumer<T> handler) -
unregister
public <T extends TachyonEvent> void unregister(@NotNull @NotNull org.bukkit.plugin.java.JavaPlugin owner, @NotNull @NotNull Class<T> eventClass, @NotNull @NotNull Consumer<T> handler) - Specified by:
unregisterin interfaceEventBus<org.bukkit.plugin.java.JavaPlugin>
-
unregisterAll
public void unregisterAll(@NotNull @NotNull org.bukkit.plugin.java.JavaPlugin owner) - Specified by:
unregisterAllin interfaceEventBus<org.bukkit.plugin.java.JavaPlugin>
-
post
-
shutdown
public void shutdown()Cleanly shuts down the event bus and its underlying thread pool.Should only be called by the Tachyon core plugin during the onDisable phase to prevent hanging async threads upon server shutdown.
-