MessageQueueController class
Unified command queue controller.
All commands -- user input, task notifications, orphaned permissions -- go through this single queue. Priority determines dequeue order: 'now' > 'next' > 'later'. Within the same priority, commands are FIFO.
- Inheritance
-
- Object
- Listenable
- ListNotifier
- SintController
- MessageQueueController
Constructors
- MessageQueueController({void onLogOperation(QueueOperation operation, String? content)?})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialized → bool
-
Checks whether the controller has already been initialized.
no setterinherited
- isClosed → bool
-
Checks whether the controller has already been closed.
no setterinherited
- isDisposed → bool
-
no setterinherited
- listenersLength → int
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
snapshot
→ RxList<
QueuedCommand> -
Frozen snapshot -- recreated on every mutation for external store pattern.
final
Methods
-
addListener(
SintStateUpdate listener) → Disposer -
Register a closure to be called when the object notifies its listeners.
inherited
-
addListenerId(
Object? key, SintStateUpdate listener) → Disposer -
inherited
-
clearCommandQueue(
) → void - Clear all commands from the queue.
-
containsListener(
SintStateUpdate listener) → bool -
inherited
-
debounce<
T> (RxInterface< T> rx, void callback(T), {Duration duration = const Duration(milliseconds: 400)}) → void -
Calls
callbackafterrxstops changing forduration. Useful for search-as-you-type, form validation, etc.inherited -
dequeue(
{bool filter(QueuedCommand)?}) → QueuedCommand? - Remove and return the highest-priority command, or null if empty.
-
dequeueAll(
) → List< QueuedCommand> - Remove and return all commands from the queue.
-
dequeueAllMatching(
bool predicate(QueuedCommand)) → List< QueuedCommand> - Remove and return all commands matching a predicate.
-
dispose(
) → void -
inherited
-
enqueue(
QueuedCommand command) → void - Add a command to the queue. Defaults priority to 'next'.
-
enqueuePendingNotification(
QueuedCommand command) → void - Add a task notification. Defaults priority to 'later'.
-
ever<
T> (RxInterface< T> rx, void callback(T)) → void -
Calls
callbackevery timerxchanges. Auto-cancels on controller disposal.inherited -
getCommandQueue(
) → List< QueuedCommand> - Get a copy of the current queue.
-
getCommandQueueLength(
) → int - Get the current queue length without copying.
-
getCommandQueueSnapshot(
) → List< QueuedCommand> - Get current snapshot of the command queue.
-
getCommandsByMaxPriority(
QueuePriority maxPriority) → List< QueuedCommand> - Get commands at or above a given priority level without removing them.
-
hasCommandsInQueue(
) → bool - Check if there are commands in the queue.
-
interval<
T> (RxInterface< T> rx, void callback(T), {Duration duration = const Duration(seconds: 1)}) → void -
Calls
callbackat most once perduration, ignoring intermediate changes. Useful for rate-limiting UI updates.inherited -
isQueuedCommandEditable(
QueuedCommand cmd) → bool - Whether this queued command can be pulled into the input buffer.
-
isQueuedCommandVisible(
QueuedCommand cmd) → bool - Whether this queued command should render in the queue preview.
-
isSlashCommand(
QueuedCommand cmd) → bool - Returns true if the command is a slash command that should be routed through processSlashCommand rather than sent to the model as text.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
once<
T> (RxInterface< T> rx, void callback(T)) → void -
Calls
callbackonly the first timerxchanges, then cancels.inherited -
onClose(
) → void -
Called before onDelete method. onClose might be used to
dispose resources used by the controller. Like closing events,
or streams before the controller is destroyed.
Or dispose objects that can potentially create some memory leaks,
like TextEditingControllers, AnimationControllers.
Might be useful as well to persist some data on disk.
inherited
-
onDelete(
) → void -
inherited
-
onInit(
) → void -
Called immediately after the widget is allocated in memory.
You might use this to initialize something for the controller.
override
-
onReady(
) → void -
Called 1 frame after onInit(). It is the perfect place to enter
navigation events, like snackbar, dialogs, or a new route, or
async request.
inherited
-
onStart(
) → void -
Called at the exact moment the widget is allocated in memory.
It uses an internal "callable" type, to avoid any @overrides in subclasses.
This method should be internal and is required to define the
lifetime cycle of the subclass.
inherited
-
peek(
{bool filter(QueuedCommand)?}) → QueuedCommand? - Return the highest-priority command without removing it.
-
popAllEditable(
{required String currentInput, required int currentCursorOffset}) → PopAllEditableResult? - Pop all editable commands and combine them with current input.
-
recheckCommandQueue(
) → void - Trigger a re-check by notifying subscribers.
-
refresh(
) → void -
inherited
-
refreshGroup(
Object id) → void -
inherited
-
remove(
List< QueuedCommand> commandsToRemove) → void - Remove specific commands from the queue by reference identity.
-
removeByFilter(
bool predicate(QueuedCommand)) → List< QueuedCommand> - Remove commands matching a predicate. Returns the removed commands.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that the
object notifies.
inherited
-
removeListenerId(
Object id, VoidCallback listener) → void -
inherited
-
reportAdd(
VoidCallback disposer) → void -
inherited
-
reportRead(
) → void -
inherited
-
resetCommandQueue(
) → void - Clear all commands and reset snapshot. Used for test cleanup.
-
subscribeToCommandQueue(
void listener()) → void Function() - Subscribe to command queue changes.
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
[List< Object> ? ids, bool condition = true]) → void -
Notifies listeners to update the UI.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited