Stefc
Stefc

Reputation: 73

TPL DataFlow call a dataflow twice times

I designed a complex dataflow consisting of various DataBlocks. I send a packet into the flow and receive a result on the end.

I work with

input.Post();
input.Complete();

// and later with
ReceiveAsync();

For the first call all works fine, but I don't know how to send the second data-packet through into the flow graph.

Inside the graph I also must use a WriteOnceBlock, can this be a problem for call the flow twice times?

Upvotes: 1

Views: 262

Answers (1)

VMAtm
VMAtm

Reputation: 28355

You cannot use any of TPL Dataflow blocks after you've called the Complete method for them or for those who linked to them with completion propagation. So either you need to recreate your pipeline for each of your call, or (which is preferred) not to call Complete just for a one call.

Suggestions to your design:

Upvotes: 2

Related Questions