Class SoulFireReactorScheduler

java.lang.Object
com.soulfiremc.server.script.SoulFireReactorScheduler
All Implemented Interfaces:
reactor.core.Disposable, reactor.core.scheduler.Scheduler

public final class SoulFireReactorScheduler extends Object implements reactor.core.scheduler.Scheduler
Adapter that wraps SoulFireScheduler to implement Reactor's Scheduler interface. This allows reactive pipelines to execute on SoulFire's virtual thread executor. Supports an optional additional RunnableWrapper for per-invocation context (e.g., bot thread-locals for trigger executions).
  • Constructor Details

  • Method Details

    • withAdditionalWrapper

      public SoulFireReactorScheduler withAdditionalWrapper(SoulFireScheduler.RunnableWrapper wrapper)
      Creates a new scheduler with an additional RunnableWrapper composed on top. The wrapper is applied to each task before delegation, ensuring thread-locals (e.g., BotConnection.CURRENT, MINECRAFT_INSTANCE) are set for all async operations.
    • schedule

      public reactor.core.Disposable schedule(Runnable task)
      Specified by:
      schedule in interface reactor.core.scheduler.Scheduler
    • schedule

      public reactor.core.Disposable schedule(Runnable task, long delay, TimeUnit unit)
      Specified by:
      schedule in interface reactor.core.scheduler.Scheduler
    • schedulePeriodically

      public reactor.core.Disposable schedulePeriodically(Runnable task, long initialDelay, long period, TimeUnit unit)
      Specified by:
      schedulePeriodically in interface reactor.core.scheduler.Scheduler
    • createWorker

      public reactor.core.scheduler.Scheduler.Worker createWorker()
      Specified by:
      createWorker in interface reactor.core.scheduler.Scheduler