MCP Commands - Queue Management

<< 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

MCP.ConfigQueue - Configure Listener Queue

PreviousTopNext


MiniRobot Language (MRL) - MCP Queue Management Commands

 

MCP.ConfigQueue / MCP.ConfigQue

Configure the Listener Queue

 

Purpose

 

The MCP.ConfigQueue command configures the MCP server's command listener queue. This allows you to set up how incoming commands are queued, processed, and managed by the server. The queue configuration determines the behavior of command processing, including maximum queue size, processing mode, and timeout settings.

 

This command is essential when:

• Setting up the MCP server for the first time

• Adjusting queue capacity for high-volume command processing

• Changing between synchronous and asynchronous processing modes

• Configuring timeout behavior for queued commands

 

Syntax

 

MCP.ConfigQueue|$$MAX_SIZE|$$MODE|$$TIMEOUT|$$RETURN_VAR

 

MCP.ConfigQue|$$MAX_SIZE|$$MODE|$$TIMEOUT|$$RETURN_VAR

 

Parameters

 

$$MAX_SIZE - The maximum number of commands that can be queued. Use 0 for unlimited (system resources permitting).

 

$$MODE - The queue processing mode: SYNC (synchronous, commands processed one at a time) or ASYNC (asynchronous, commands may be processed concurrently).

 

$$TIMEOUT - The timeout in milliseconds for queue operations. Use 0 for no timeout (wait indefinitely).

 

$$RETURN_VAR - The variable that will receive the result code (0 for success, non-zero for error).

 

Return Value

 

0 - Queue configured successfully

1 - Invalid parameter (invalid mode or negative size)

2 - MCP server not running

3 - Configuration failed (queue in use)

 

Examples

 

' Example 1: Configure queue for synchronous processing with 100 command limit

MCP.ConfigQueue|100|SYNC|5000|$$Result

IVV.$$Result!0

PRT.Queue configured successfully

ELS.

PRT.Configuration failed: $$Result

EIF.

 

' Example 2: Unlimited queue with asynchronous processing

MCP.ConfigQueue|0|ASYNC|0|$$Result

 

' Example 3: High-volume processing with 10-second timeout

MCP.ConfigQue|500|ASYNC|10000|$$Status

 

Remarks

 

The MCP.ConfigQueue command can only be executed when the MCP server is running. If the queue is currently processing commands, the configuration change may be delayed until the current batch completes.

 

In SYNC mode, commands are executed sequentially in the order they are received. This ensures predictable behavior but may reduce throughput for I/O-bound operations. In ASYNC mode, commands may be executed concurrently, improving throughput but potentially changing execution order.

 

MCP.ConfigQueue and MCP.ConfigQue are aliases for the same command.

 

Error Conditions

 

The command will fail with a parameter error if:

• The mode is not SYNC or ASYNC

• The max size is negative

• Too few or too many parameters are provided

 

See also:

 

MCP.ResetQueue - Reset the Queue

MCP.GetQueueCount - Get Queue Count

MCP.GetQueueMode - Get Queue Mode

Queue Management Overview