I am using TIdNotify like this:
type
TMsgNotify = class(TIdNotify)
protected
aMsgStr: string;
procedure DoNotify; override;
end;
procedure TMsgNotify.DoNotify;
begin
// this runs in the main thread
Form1.Log(aMsgStr);
end;
procedure TForm1.IdHTTPServer1CommandGet(AContext: TIdContext;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
begin
try
...
if ARequestInfo.Command = 'POST' then
begin
//do Msg thread
with TMsgNotify.Create do begin
aMsgStr:='>> RawHTTP Command: ' + ARequestInfo.RawHTTPCommand;
Notify;
// Do not call Free(), TIdNotify will free itself when it is finished...
end;
...
end;
finally
...
end;
end;
When compiled in Embarcadero Delphi Tokyo I get this message:
[dcc64 Warning] Unit1.pas(230): W1000 Symbol 'TIdNotify' is deprecated: 'Use static TThread.Queue()'
What is proper way to recode this for new version of Delphi?