RecordTaskEventsMixin<T> mixin
A special type of Manager that records events of onEventCallback and allows accessing them through getRecordedEvent
- Superclass constraints
- Manager<
T>
- Manager<
- @Deprecated('Starting from 0.4.0, Manager class supports the following methods of the mixin be default')
Properties
-
eventSnapshotTable
→ Map<
String, TaskEvent< T> > -
no setterinherited
-
eventTable
→ Map<
String, TaskEvent< T> > -
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDisposed → bool
-
If dispose was called on the manager
no setterinherited
-
onUpdated
→ Stream<
void> -
Emits an event each time on or onStateChanged fires an event.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → T
-
Current state of the manager.
no setterinherited
Methods
-
deleteRecordEvent(
{required String taskId}) → void -
Deletes an reference of the event of the
taskId
from the_eventTable
map -
dispose(
) → void -
Closing all the sinks of manager.
inherited
-
getAsyncReferenceOf(
{required String taskId}) → AsyncTaskCompleterReference< T> ? -
Gives a reference for the AsynchronousTask tracked by the manager by
taskId
.inherited -
getEventSnapshot(
{required String taskId}) → TaskEvent< T> ? -
All events coming from onEventCallback are recorded in the
_eventSnapshotTable
map and can be accessed by this method usingtaskId
.inherited -
getRecordedEvent(
{required String taskId}) → TaskEvent< T> ? -
All events coming from onEventCallback are recorded in the
_eventTable
map and can be accessed by this method usingtaskId
. -
kill(
CancelableAsyncTaskMixin< T> task) → Future<void> -
inherited
-
killById(
{required String taskId}) → Future< void> -
Deletes a reference of the event of the
taskId
from the_eventTable
map before the task oftaskId
is killedoverride -
mutateState(
T newState) → void -
This method changes the
_state
and adds events to onStateChangedinherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
on<
S extends Task< (T> >{String? taskId, bool withLatest = false}) → Stream< TaskEvent< T> > -
Emits TaskEvent while tracking the Tasks
inherited
-
onEventCallback(
TaskEvent< T> event) → void -
Records the
event
into the_eventTable
override -
onStateChanged(
{bool withLatest = false}) → Stream< T> -
Emits an event each time the state is changed in mutateState
inherited
-
recordEvent(
TaskEvent< T> event) → void -
Saves the
event
into_eventTable
map -
recordEventSnapshot(
TaskEvent< T> event) → void -
Saves the
event
into_eventSnapshotTable
mapinherited -
run(
Task< T> task) → void -
- If the manager runs a SynchronousTask - only TaskSuccessEvent will be added to the on stream.
- If the manager runs an AsynchronousTask - the events will be added to the on stream depending on following cases:
- It add TaskLoadingEvent to the on stream before running AsynchronousTask.run. If the manager is already tracking
a task with the same Task.id and if the
task
is CancelableAsyncTaskMixin - atask
will be killed before running. (TaskKillEventwont't
be emitted) - If future AsynchronousTask.run of
task
completes without error - TaskSuccessEvent will be added to the on stream and mutateState will be called and the state gets mutated. (If the reference to this task is not outdated.)
inherited -
safelyExtractTaskIdFromString(
String taskId) → String -
Encapsulated method to form the
taskId
to get a reference of tasks properlyinherited -
safelyGetTaskIdFromTask(
Task< T> task) → String -
Encapsulated method to form the id of Task to get a reference properly
inherited
-
testAsyncTaskIdPivotGeneratorRaw(
String taskId) → String -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
waitForTaskToBeDone(
{required String taskId}) → Future< void> -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited