My DataFlow pipeline starts with a BatchBlock
. I would like to trigger the BatchBlock
with the help of the TriggerBatch()
method. My batch sizes can be variable, so when creating the Batchblock
I have placed a rather high BatchSize
which I don't really expect to be reached.
Now I would like to call the TriggerBatch()
method depending on the fact that whether the BatchBlock
indeed has some elements in it which could infact be triggered into a batch. Is there a way to check whether the internal buffer of the Batchblock
is non-empty? If not, could someone please suggest a solution for the same to me. The BatchBlock
is being fed from multiple threads which Post()
data into the Batchblock
. However I would like a mechanism which could wait until there are elements present in the Batchblock
before triggering it. Basically I would not want my TriggerBatch()
to be fruitless. Unfortunately, using a timer is not an option for me.
At this point I do need a third persons opinion as I have been stuck on this for quite a while now.