|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Internet and Network > MCP. - MCP (Model-Context Protocol) server operations > Queue Management - Listener queue operations > MCP Commands - Queue Management |
MiniRobot Language (MRL) - MCP Queue Management Commands
MCP.GetQueueMode
Get the Current Queue Processing Mode
Purpose
The MCP.GetQueueMode command retrieves the current processing mode of the MCP server's command queue. This allows scripts to determine whether commands are being processed synchronously (one at a time, in order) or asynchronously (concurrently, potentially out of order).
This command is useful when:
• Checking the current queue configuration before submitting commands
• Adapting script behavior based on processing mode
• Debugging queue-related issues
• Verifying configuration changes took effect
Syntax
MCP.GetQueueMode|$$RETURN_VAR
Parameters
$$RETURN_VAR - The variable that will receive the queue mode string. Returns "SYNC", "ASYNC", or "ERROR" if the server is not running.
Return Value
SYNC - Synchronous mode: commands processed one at a time, in order
ASYNC - Asynchronous mode: commands may be processed concurrently
ERROR - MCP server not running or error condition
Examples
' Example 1: Check current queue mode
MCP.GetQueueMode|$$Mode
PRT.Current queue mode: $$Mode
' Example 2: Adapt behavior based on queue mode
MCP.GetQueueMode|$$CurrentMode
IVV.$$CurrentMode=SYNC
PRT.Processing in synchronous mode
' Commands will execute in order
ELS.
PRT.Processing in asynchronous mode
' Commands may execute concurrently
EIF.
' Example 3: Ensure synchronous mode before critical operations
MCP.GetQueueMode|$$ModeCheck
IVV.$$ModeCheck!=SYNC
PRT.Warning: Not in synchronous mode
' Reconfigure for synchronous processing
MCP.ConfigQueue|100|SYNC|5000|$$ConfigResult
EIF.
Remarks
The queue mode determines how commands are processed by the MCP server. Understanding the mode is important for writing scripts that behave correctly:
SYNC Mode:
• Commands execute one at a time
• Execution order is guaranteed
• Easier to predict results
• May be slower for I/O-bound operations
ASYNC Mode:
• Commands may execute concurrently
• Execution order is not guaranteed
• Better throughput for independent operations
• Requires careful handling of dependencies
Error Conditions
The command will fail with a parameter error if:
• The return variable parameter is missing
• Too many parameters are provided
See also:
• MCP.ConfigQueue - Configure Listener Queue
• MCP.GetQueueCount - Get Queue Count