NeatStatusProvider class abstract
Abstractions for getting and setting task status.
This must abstract some optimistically consistent piece of a data storage service. The get method returns the current status file, and if the current status file has not changed when set is called, the status is updated and set return true.
Notice that the definition above makes this object stateful, as it must remember the value last time it was read. This also means that a specific instance of NeatStatusProvider must only be given to one NeatPeriodicTaskScheduler.
Generally, services like Google Cloud Storage offers an etag
that enables
optimistic concurrency. Hence, an object implementing this interface would
only need to store the etag
and make all updates conditional.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
get(
) → Future< List< int> ?> - Get the current status file.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
set(
List< int> status) → Future<bool> - Set the current status file, if status file have not been changed since last time it was read.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
withRetry(
NeatStatusProvider provider, {RetryOptions options = const RetryOptions()}) → NeatStatusProvider - Wrap a NeatStatusProvider such that get/set are retried on any Exception.