|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Internet and Network > MCP. - MCP (Model-Context Protocol) server operations > !Server-Operations - Commands for interacting with a running MCP server (signals, actions) > MCP. - MCP Server Operations |
SPR Script Language
HTP.MCPGetQueueMode
Gets the current retrieval mode of the Listener queue ("STACK" or "QUE").
Intention
When using the MCP server in Listener Mode, commands are stored in a queue. This queue can operate in two different ways, configurable via MCP.ConfigQue. The HTP.MCPGetQueueMode command allows you to check the current behavior of the queue before you start retrieving commands.
Knowing the mode is crucial for processing commands in the correct order. If the mode is "QUE", you process the oldest command first. If it's "STACK", you process the newest command first.
Illustration
🍽️ Serving Style: Is the server a buffet line or a stack of plates?
➡️ "QUE": A queue (First-In, First-Out), like a buffet line.
📚 "STACK": A stack (Last-In, First-Out), like a stack of clean plates.
Syntax
HTP.MCPGetQueueMode[|$$RET]
Parameter Explanation
P1 - $$RET - (Variable, Optional)
A variable (e.g., $$mod) to store the result string ("STACK" or "QUE"). If omitted, the result is pushed to the top of the stack (TOS).
Examples
'***********************************
' HTP.MCPGetQueueMode - Sample 1: Check the Default Mode
'***********************************
MCP.Init
HTP.MCPGetQueueMode|$$mod
MBX.The default queue mode is: $$mod
ENR.
'
'***********************************
' HTP.MCPGetQueueMode - Sample 2: Change and Verify Mode
'***********************************
MCP.Init
' Change the mode to LIFO
MCP.ConfigQue|STACK
' Verify the change
HTP.MCPGetQueueMode|$$mod
IVS.$$mod=STACK
MBX.Success! The queue mode is now STACK.
ELS.
MBX.Error: The queue mode was not set correctly.
EIF.
ENR.
Remarks
- The default mode for the queue is "QUE" (FIFO).
- This command is only relevant when the server is running in Listener Mode.
See also: