TsgcWSAPIClient_MCP › Events › OnMCPSubscriptionClosed

OnMCPSubscriptionClosed Event

Fires when a subscription ends.

Syntax

property OnMCPSubscriptionClosed: TsgcAI_MCP_Client_OnSubscriptionClosedEvent;
// TsgcAI_MCP_Client_OnSubscriptionClosedEvent = procedure(Sender: TObject; const aSubscriptionId: string; aGraceful: Boolean) of object

Default Value

—

Remarks

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.

Example

procedure TMainForm.MCPSubscriptionClosed(Sender: TObject;
  const aSubscriptionId: string; aGraceful: Boolean);
begin
  Log('closed ' + aSubscriptionId);
end;

Back to Events