AuraTrader Sample
This commit is contained in:
@@ -49,6 +49,8 @@ type
|
||||
|
||||
class property Null: IFuture read FNull;
|
||||
|
||||
procedure Manage;
|
||||
|
||||
function Chain<S>(const Proc: TFunc<T, S>): TFuture<S>; overload;
|
||||
function Chain<S>(const Proc: TFuncConst<T, S>): TFuture<S>; overload;
|
||||
function WaitFor: T;
|
||||
@@ -113,6 +115,12 @@ begin
|
||||
Result := FFuture.Value;
|
||||
end;
|
||||
|
||||
procedure TFuture<T>.Manage;
|
||||
begin
|
||||
if GetTypeKind(T) = tkClass then
|
||||
FFuture := TMycFutureManaged<T>.Create(FFuture);
|
||||
end;
|
||||
|
||||
function TFuture<T>.WaitFor: T;
|
||||
begin
|
||||
TaskManager.WaitFor(FFuture.Done);
|
||||
|
||||
Reference in New Issue
Block a user