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 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)
      Specified by:
      register in interface EventBus<org.bukkit.plugin.java.JavaPlugin>
    • 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:
      unregister in interface EventBus<org.bukkit.plugin.java.JavaPlugin>
    • unregisterAll

      public void unregisterAll(@NotNull @NotNull org.bukkit.plugin.java.JavaPlugin owner)
      Specified by:
      unregisterAll in interface EventBus<org.bukkit.plugin.java.JavaPlugin>
    • post

      public <T extends TachyonEvent> void post(@NotNull T event)
      Specified by:
      post in interface EventBus<org.bukkit.plugin.java.JavaPlugin>
    • 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.