parallel PathData creation
This commit is contained in:
@@ -101,7 +101,7 @@ type
|
||||
// Used by cache to actually load an uncached file.
|
||||
function DoLoad(const FileName: string): TFuture<TArray<TDataPoint<T>>>;
|
||||
|
||||
function LoadFile(currFile: TAuraDataFile; Terminated: TState; Proc: TDataProc<T>): TState;
|
||||
function LoadFile(DataFile: TAuraDataFile; Terminated: TState; Proc: TDataProc<T>): TState;
|
||||
|
||||
strict private
|
||||
class var
|
||||
@@ -400,19 +400,19 @@ begin
|
||||
Result := FCachedFiles.GetOrAdd(DataFile.GetFullFileName);
|
||||
end;
|
||||
|
||||
function TAuraDataServer<T>.LoadFile(currFile: TAuraDataFile; Terminated: TState; Proc: TDataProc<T>): TState;
|
||||
function TAuraDataServer<T>.LoadFile(DataFile: TAuraDataFile; Terminated: TState; Proc: TDataProc<T>): TState;
|
||||
begin
|
||||
if not currFile.IsValid or Terminated.IsSet then
|
||||
if not DataFile.IsValid or Terminated.IsSet then
|
||||
exit(TState.Null);
|
||||
|
||||
var data := FCachedFiles.GetOrAdd(currFile.GetFullFileName);
|
||||
var data := FCachedFiles.GetOrAdd(DataFile.GetFullFileName);
|
||||
|
||||
Result :=
|
||||
data.Chain(
|
||||
function(const Data: TArray<TDataPoint<T>>): TState
|
||||
begin
|
||||
Proc(Data, Terminated);
|
||||
Result := LoadFile(currFile.GetNextFile, Terminated, Proc);
|
||||
Result := LoadFile(DataFile.GetNextFile, Terminated, Proc);
|
||||
end
|
||||
);
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user