Is there a way to create a callback function that fires when a list object (any Class implementing the ICollection interface of C#.NET) reaches a certain capacity (number of items in the list)?
I would like an event to fire when my list object has 5 elements for example.
To place you in context, I am doing that to batch data processing since I am running a service that utilizes HTTP over the network and batching is necessary for the performance of my application.
a simple implementation is batching in memory (in a list) and fire when it reaches some capacity and then send over the network or if there are other tools I would appreciate any pointers to them.
Thanks