TimerMessagingQueue class
A message queue that dispatch a new key every timing.
It is paused by default so won't dispatch any item until you resume it.
- Inheritance
-
- Object
- MessagingQueue
- TimerMessagingQueue
Constructors
- TimerMessagingQueue({required MessagingQueueDispatcher dispatcher, bool isPaused = true, ResumeQueueStrategy resumeStrategy = ResumeQueueStrategy.nothing, Duration timing = const Duration(milliseconds: 500)})
- Constructor
Properties
- dispatcher → MessagingQueueDispatcher
-
Callback that will be called every time a message by its key
should be dispatched to subscribers
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Check if the queue is empty
no setterinherited
- isNotEmpty → bool
-
Check if the queue is not empty
no setterinherited
-
items
→ Iterable<
QueueItem< String> > -
Get unordered list of items inside the queue
no setterinherited
- length → int
-
Get number of items in queue
no setterinherited
- paused → bool
-
Check if the queue is paused
no setterinherited
- resumeStrategy → ResumeQueueStrategy
-
Strategy to apply during resume
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timing → Duration
-
Duration between each timer loop
final
Methods
-
addQueueItem(
QueueItem< String> item) → void -
Add key of a message to queue
inherited
-
cancel(
) → void - Cancel the timer
-
dispatchQueuedItem(
) → void -
Dispatch item using dispatcher
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onItemAddedToQueue(
) → void -
Action called when item is added in the queue
inherited
-
pause(
) → void -
Pause the dispatch of item
inherited
-
reset(
) → void -
Reset the queue
override
-
resume(
) → void -
Resume the dispatch of item
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited