procedure TMainForm.Button3Click(Sender: TObject);
var
promise: TPromise;
begin
promise := AsyncCallProc(
procedure
var
rand: integer;
begin
TThread.Synchronize(nil,
procedure
begin
(Sender as TButton).Text := 'Начал выполнение';
end);
Sleep(1000);
rand := Random(2);
case rand of
0:
begin
end;
1:
begin
raise Exception.Create('My Exception')
end;
end;
TThread.Synchronize(nil,
procedure
begin
(Sender as TButton).Text := 'Закончил выполнение';
end);
end);
promise.Resolve := Resolve;
promise.Reject := Reject;
end;
procedure TMainForm.Button3Click(Sender: TObject);
begin
AsyncCallProc(
procedure
begin
(Sender as TButton).Text := 'Начал выполнение';
Sleep(5000);
(Sender as TButton).Text := 'Закончил выполнение';
end);
end;
root@csrt:~# sudo apt remove ispmanager-plugin-revisium
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'ispmanager-plugin-revisium' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDdlrdZwV3+GF9q7rhc6vYrExwT4WU4fsaRcVXGV2Mg9RHex21hl1au77GkmnIgukBZjywlQOT4GDdsJy2nBOdJPrCEBIP6t0Mk5aPkK/fctNuKjcmMMOA8YUT+sJKn3l7rCLkesE+S5880yNdRjBiiUy40kyr7Y+fqGVdSOHGMXZQPpkBtojcV14uAy0yV6/htEqGa/Jq4fH7bR6CYQ2XgH/hCap29Mdi/G5Tx1nbUKuIHdMWOPvjGACGcXclex+lHtTGiAIRG1riyNRVC47ZEVCxxxxxx