04-11-2019 01:17 PM
@Bob_Schor wrote:
Can we all agree that, no matter what the communication paradigm between Producer and Consumer, that communication must be maintained until the Consumer reads the last valid data sent by the Producer? A "last element?" signal sent from Producer (who knows when it stops sending data) to the Consumer tells the Consumer when it can exit, and when it does, then both Consumer and Producer are finished communicating and the "pathway" can be abandoned/released/destroyed without generating "errors" or risking missing data. There are many ways to do this, but something that flows along with the data seems (to me) to be the simplest and most fool-proof.
Bob Schor
Of course - the easiest way (using conventional queues) is to merge all the error wires coming out of the loops and put any queue destructions behind that. Since dataflow says the merge error cannot execute until all its inputs are satisfied, it's an easy way to ensure everything is complete before you destroy stuff.
04-11-2019 01:25 PM
@altenbach wrote:
@Bob_Schor wrote:
Can we all agree that, no matter what the communication paradigm between Producer and Consumer, that communication must be maintained until the Consumer reads the last valid data sent by the Producer?
I actually disagree. The original requirement was to stop the consumer when the producer is done. It was not specified that all queued data needs to be processed. 🙂
You're right. Though I imagine the OP probably does want the consumer to finish all queued elements even after the producer is done.
04-11-2019 02:42 PM
@altenbach wrote:
@Bob_Schor wrote:
Can we all agree that, no matter what the communication paradigm between Producer and Consumer, that communication must be maintained until the Consumer reads the last valid data sent by the Producer?
I actually disagree. The original requirement was to stop the consumer when the producer is done. It was not specified that all queued data needs to be processed. 🙂
I have yet to run into an application where it was ok to drop data like that. So I am 100% on board with Bob: some type of messaging needs to be done IN THE COMMUNICATION PATH that the producer sent its last data point and the consumer should then stop.