Class DefaultProgressSubscriber

java.lang.Object
com.plotsquared.core.queue.subscriber.DefaultProgressSubscriber
All Implemented Interfaces:
ProgressSubscriber

public class DefaultProgressSubscriber extends Object implements ProgressSubscriber
The default PlotSquared Progress Subscriber. Can be used for both console and player tasks. It is the ProgressSubscriber returned by ProgressSubscriberFactory. Runs a repeating synchronous task notifying the given actor about any updates, saving updates notified by the ChunkCoordinator.
  • Constructor Details

    • DefaultProgressSubscriber

      public DefaultProgressSubscriber()
    • DefaultProgressSubscriber

      public DefaultProgressSubscriber(@Nullable PlotPlayer<?> actor)
    • DefaultProgressSubscriber

      public DefaultProgressSubscriber(@Nullable PlotPlayer<?> actor, long interval, long wait, @Nullable Caption caption)
  • Method Details

    • notifyProgress

      public void notifyProgress(@NonNull ChunkCoordinator coordinator, double progress)
      Description copied from interface: ProgressSubscriber
      Notify about a progress update in the coordinator
      Specified by:
      notifyProgress in interface ProgressSubscriber
      Parameters:
      coordinator - Coordinator instance that triggered the notification
      progress - Progress in the range [0, 1]
    • notifyEnd

      public void notifyEnd()
      Description copied from interface: ProgressSubscriber
      Notify the subscriber that its parent ChunkCoordinator has finished
      Specified by:
      notifyEnd in interface ProgressSubscriber
    • cancel

      public void cancel()