monitor_messages method
Message monitor performs background monitoring for a message processing results for the specified set of messages.
Message monitor can serve several isolated monitoring queues. Each monitor queue has a unique application defined identifier (or name) used to separate several queue's.
There are two important lists inside of the monitoring queue:
-
unresolved messages: contains messages requested by the application for monitoring and not yet resolved;
-
resolved results: contains resolved processing results for monitored messages.
Each monitoring queue tracks own unresolved and resolved lists. Application can add more messages to the monitoring queue at any time.
Message monitor accumulates resolved results.
Application should fetch this results with fetchNextMonitorResults function.
When both unresolved and resolved lists becomes empty, monitor stops any background activity and frees all allocated internal memory.
If monitoring queue with specified name already exists then messages will be added to the unresolved list.
If monitoring queue with specified name does not exist then monitoring queue will be created with specified unresolved messages.
Implementation
Future<void> monitor_messages(ParamsOfMonitorMessages params) async {
await _tonCore.request('processing.monitor_messages', params.toString());
}