TsgcWSAPIClient_MCP › Events › OnMCPTaskStatus

OnMCPTaskStatus Event

Fires when the status of a task changes.

Syntax

property OnMCPTaskStatus: TsgcAI_MCP_Client_OnTaskEvent;
// TsgcAI_MCP_Client_OnTaskEvent = procedure(Sender: TObject; const aTask: TsgcAI_MCP_Client_Task) of object

Default Value

—

Remarks

Raised by the poller (MCPOptions.Tasks.AutoPoll) when the status, the status message or the requested inputs change, and by every call to TasksGet.

When raised by the poller the event runs in the background thread of the task; use TThread.Queue or TThread.Synchronize to update visual controls. See Tasks.

Example

procedure TMainForm.MCPTaskStatus(Sender: TObject;
  const aTask: TsgcAI_MCP_Client_Task);
begin
  Log(aTask.TaskId + ': ' + aTask.StatusMessage);
end;

Back to Events