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 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
-
DefaultProgressSubscriber
public DefaultProgressSubscriber(@Nullable PlotPlayer<?> actor, long interval, long wait, @Nullable Caption caption)
-
-
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
Description copied from interface:ProgressSubscriber
Notify the subscriber that its parent ChunkCoordinator has finished- Specified by:
notifyEnd
in interfaceProgressSubscriber
-
cancel
-