Class DefaultProgressSubscriber
java.lang.Object
com.plotsquared.core.queue.subscriber.DefaultProgressSubscriber
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionDefaultProgressSubscriber(PlotPlayer<?> actor)DefaultProgressSubscriber(PlotPlayer<?> actor, long interval, long wait, Caption caption) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()voidNotify the subscriber that its parent ChunkCoordinator has finishedvoidnotifyProgress(@NonNull ChunkCoordinator coordinator, double progress)Notify about a progress update in the coordinator
-
Constructor Details
-
DefaultProgressSubscriber
public DefaultProgressSubscriber() -
DefaultProgressSubscriber
-
DefaultProgressSubscriber
public DefaultProgressSubscriber(@Nullable PlotPlayer<?> actor, long interval, long wait, @Nullable Caption caption)
-
-
Method Details
-
notifyProgress
Description copied from interface:ProgressSubscriberNotify about a progress update in the coordinator- Specified by:
notifyProgressin interfaceProgressSubscriber- Parameters:
coordinator- Coordinator instance that triggered the notificationprogress- Progress in the range [0, 1]
-
notifyEnd
public void notifyEnd()Description copied from interface:ProgressSubscriberNotify the subscriber that its parent ChunkCoordinator has finished- Specified by:
notifyEndin interfaceProgressSubscriber
-
cancel
public void cancel()
-