onNewData is stopping current run
recser opened this issue · comments
Hello,
a question regarding any recommendations for implementing the onNewData functionality. Currently due to some processing inside onNewData method (splitting, deduping and so on) the execution of the method takes some small amount the time during which other new events of new data may come which interrupts current run and starts evaluating new data.
Is there a proven method to handle this kind of scenarios ?
I am currently implementing a queue based approach where onNewData would push new data into the queue, and another thread would read from that queue and process separately the data.
Was wondering if this is the right approach or if there are any other ways of achieving a completion of processing before new data comes in?
thank you for taking your time to answer, appreciated!