Adding Pipes

This commit is contained in:
Michael Schimmel
2025-12-18 11:58:41 +01:00
parent 8bde31a478
commit 34b4466a15
8 changed files with 45 additions and 32 deletions
+6 -8
View File
@@ -8,6 +8,7 @@ uses
System.Generics.Collections,
System.SyncObjs,
Myc.Data.Scalar,
Myc.Data.Keyword,
Myc.Data.Value,
Myc.Core.Notifier;
@@ -47,8 +48,7 @@ type
{$region 'private'}
function GetStream: IStream;
{$endregion}
procedure Push(const Value: IScalarRecord);
procedure Push(const Value: IKeywordMapping<TScalar>);
property Stream: IStream read GetStream;
end;
@@ -73,11 +73,11 @@ type
private
FName: string;
FSeries: IWriteableScalarRecordSeries;
FQueue: TQueue<IScalarRecord>;
FQueue: TQueue<IKeywordMapping<TScalar>>;
FQueueLock: TSpinLock;
FObservers: TStreamNotifier;
procedure Push(const Value: IScalarRecord);
procedure Push(const Value: IKeywordMapping<TScalar>);
function GetStream: IStream;
function Subscribe(const Observer: IStreamObserver): TSubscriptionTag;
procedure Unsubscribe(Tag: TSubscriptionTag);
@@ -125,7 +125,7 @@ begin
inherited Create;
FName := AName;
FSeries := ASeries;
FQueue := TQueue<IScalarRecord>.Create;
FQueue := TQueue<IKeywordMapping<TScalar>>.Create;
end;
destructor TGraphExecutor.TChannel.Destroy;
@@ -135,10 +135,8 @@ begin
inherited;
end;
procedure TGraphExecutor.TChannel.Push(const Value: IScalarRecord);
procedure TGraphExecutor.TChannel.Push(const Value: IKeywordMapping<TScalar>);
begin
Assert(Value.Def = FSeries.Def);
FQueueLock.Enter;
try
FQueue.Enqueue(Value);