TsgcWSAPIClient_MCP › Events › OnMCPSubscriptionAcknowledged

OnMCPSubscriptionAcknowledged Event

Fires when the server accepts a subscription opened with subscriptions/listen.

Syntax

property OnMCPSubscriptionAcknowledged: TsgcAI_MCP_Client_OnSubscriptionAcknowledgedEvent;
// TsgcAI_MCP_Client_OnSubscriptionAcknowledgedEvent = procedure(Sender: TObject; const aSubscriptionId, aNotifications: string) of object

Default Value

—

Remarks

aSubscriptionId is the value returned by SubscriptionsListen. aNotifications is the raw JSON of the notifications the server honors, which can be a subset of the requested ones.

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.MCPSubscriptionAcknowledged(Sender: TObject;
  const aSubscriptionId, aNotifications: string);
begin
  Log('listening ' + aSubscriptionId + ': ' + aNotifications);
end;

Back to Events