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
ConstructorDescriptionDefaultProgressSubscriber(PlotPlayer<?> actor)
DefaultProgressSubscriber(PlotPlayer<?> actor, long interval, long wait, Caption caption)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
void
Notify the subscriber that its parent ChunkCoordinator has finishedvoid
notifyProgress(@NonNull ChunkCoordinator coordinator, double progress)
Notify about a progress update in the coordinator
-
Constructor Details
-
DefaultProgressSubscriber
public DefaultProgressSubscriber() -
DefaultProgressSubscriber
-
-
Method Details
-
notifyProgress
Description copied from interface:ProgressSubscriber
Notify about a progress update in the coordinator- Specified by:
notifyProgress
in interfaceProgressSubscriber
- Parameters:
coordinator
- Coordinator instance that triggered the notificationprogress
- 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 interfaceProgressSubscriber
-
cancel
public void cancel()
-