Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

HGMAsync

Async wrapper

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

HGMAsync

Async wrapper

Samples

pascal
Async.Sync(GlobalWaitBegin);

Async.Run<Boolean>(
  function: Boolean
  begin
    Result := LongWorkWithBooleanResult;
  end,
  procedure(Result: Boolean)
  begin
    try
      if Result then
      begin
        ShowAllFine;
      end
      else
        ShowError;
    finally
      GlobalWaitEnd;
    end;
  end);
pascal
Async.Run(ConnectChatAsync);
pascal
procedure TFormMain.LogAsync(const Text: string);
begin
  Async.Sync<string, integer>(MemoLog.Lines.Add, FormatDateTime('HH:NN:SS.ZZZZZZ', Now) + #13#10 + Text);
end;
pascal
GlobalWaitBegin;
Async.Run(LoadServersAsync, GlobalWaitEnd);