TsgcWSAPIClient_MCP › Events › OnMCPSubscriptionClosed
Fires when a subscription ends.
property OnMCPSubscriptionClosed: TsgcAI_MCP_Client_OnSubscriptionClosedEvent;
// TsgcAI_MCP_Client_OnSubscriptionClosedEvent = procedure(Sender: TObject; const aSubscriptionId: string; aGraceful: Boolean) of object
—
aGraceful is True when the server ended the subscription with a final result, and False when the connection was lost or the subscription was cancelled.
With the HTTP transports the event runs in a background thread; use TThread.Queue or TThread.Synchronize to update visual controls. See Subscriptions.
procedure TMainForm.MCPSubscriptionClosed(Sender: TObject;
const aSubscriptionId: string; aGraceful: Boolean);
begin
Log('closed ' + aSubscriptionId);
end;