Questions tagged [tpl-dataflow]

TPL Dataflow (TDF) is a .NET library for building concurrent applications. It promotes actor/agent-oriented designs through primitives for in-process message passing, dataflow, and pipelining. TDF builds upon the TPL (Task Parallel Library) in .NET 4 and integrates with async language support in C#, Visual Basic, and F#. TDF lacks join/merge by key (like SSIS) and time-based windowing (available in Rx).

Platform: .NET Framework 4.0 / .NET Core / .NET 6

Promotes: actor/agent programming model

Strengths: limiting parallelism (for example reading from disk bound vs. CPU compute bound tasks would be limited differently), data flow via message passing, integration with other .NET libraries like Rx and TPL.

Weaknesses: no data flow merge by key (like SSIS merge operation), and only the most trivial of time windowing (compare BroadcastBlock with Rx BufferWithTime() or CEP/StreamInsight windowing operators)

629 questions
-1
votes
1 answer

Continuous job queue finish jobs before closure

Using the following code, I’m using a .net core Background Service with a continuous job queue where inside the ExecuteAsync simulates a job been added to the queue (this could be collecting an order, producing order responses etc) The background…
Houlahan
  • 783
  • 3
  • 19
  • 46
-1
votes
1 answer

Why is Stream.CopyTo not writing directly to a file?

This action block is connected to a transform block with the signaturevar getStream = new TransformBlock, FileChunk>> however, the stream is not writing directly to the file provided. For some reason, I…
-1
votes
1 answer

C# TransformBlock is not executed after calling Complete function

I have this code snippet: static void Main(string[] args) { var printResult = new ActionBlock(x => { Console.WriteLine(x); }); var countBytes = new TransformBlock( new Func((x)=> { return 2 *…
Troskyvs
  • 7,537
  • 7
  • 47
  • 115
-1
votes
1 answer

TPL Dataflow execution output order

In the below test code, I am expecting this outcome: 1, 2000 2, 4000 3, 6000 However the actual outcome is: 3, 6000 2, 4000 1, 2000 Moreover, i only see the outcome on screen after 6 seconds. Which means anything input that is competed is…
user1912383
  • 359
  • 2
  • 6
  • 16
-1
votes
3 answers

Does linking keep the linked block alive?

When using System.Threading.Tasks.Dataflow, if I link block a to block b, will the link keep b alive? Or do I need to keep a reference to b around to prevent it from being collected? internal class SomeDataflowUser { public SomeDataflowUser() …
Haukinger
  • 10,420
  • 2
  • 15
  • 28
-1
votes
1 answer

ActionBlock never completes on Faulted State

I am trying to make a simple program to better understand TPL Dataflow. I am trying to create a long running task that will restart a dataflow block if it has completed. My current RestartActionBlock Task is able to await completion of the…
Slvrfn
  • 644
  • 2
  • 7
  • 17
-1
votes
2 answers

Dataflow Task.WhenAll causes A task was canceled Exception

I am new to Dataflow, and I follow this walkthrough How to: Cancel a Dataflow Block. I click add button first, and then click cancel, but I got exception about "A task was canceled Exception" after clicking cancel button. I fail to find any way to…
Edward
  • 28,296
  • 11
  • 76
  • 121
-1
votes
2 answers

Understanding exception handling in ActionBlock

Can someone explain why the first code block will throw when we await the completion of the action block while second code block doesn't? There isn't any chaining of dataflow blocks so no propagation is required. ActionBlock definition…
RLV
  • 51
  • 3
-1
votes
2 answers

how .Net Task Parallel Library dataflow send message to many clients with not only one cache?

There is a Server Task, which uses TPL Dataflow to send messages to many clients Task. Client connects to the server randomly Client can send message to server and client can receive message from server Server use a BufferBlock to send…
liyonghelpme
  • 67
  • 1
  • 5
-1
votes
1 answer

BufferBlock -> ActionBlock Not Firing

In Short I create an BatchBlock which links to an ActionBlock, which calls a async method, but this method never fires. Details Here is how I create the blocks var instance = new ConnectionSaveStep(repo, progress, total); var batch =…
Boas Enkler
  • 12,264
  • 16
  • 69
  • 143
-1
votes
1 answer

Implementing Asynchronous Search of a Text File

I'm creating a Windows form application that allows the user to specify a text file as a data source, dynamically creates the form controls based on the number of columns in the file, and allows the user to input search parameters which will be used…
-2
votes
1 answer

Create a pipeline that doesn't overload memory

I'm creating a pipeline where you need to: read from files and make transformations [TRANSFORM_1]; with the transformed data I have to do 2 procedures: do another transformation (very expensive for the CPU) [TRANSFORM_2] perform an action that I…
NickMan
  • 23
  • 4
-2
votes
1 answer

Can I make TPL DataFlow BatchBlock Singleton?

All the example I can find shows that I have to call .Complete() to get messages pushed to next node, I am wondering If I make BatchBlock Singlton, and have it receive messasges continuously, auto push messagses to next block when messasges reach…
yuahorse
  • 21
  • 3
-3
votes
1 answer

TPL Dataflow uses old data instead of the newest

I'm using TPL Dataflow in order to perform one task per symbol at a time. The first two Operation taking... messages are correct but the next ones are using old data. In other words, it uses the old data marked with green on the screenshot below,…
nop
  • 4,711
  • 6
  • 32
  • 93
1 2 3
41
42