dam4rus commented on pull request #992:
URL: https://github.com/apache/nifi-minifi-cpp/pull/992#issuecomment-780677873


   TBH, I don't really see how `Connection::poll()` could be refactored, since 
I'm not super familiar with the code base, to avoid performance degradation 
with `ConcurrentQueue` since it has a more complex structure. Using a lambda 
would be weird since the loop has `break` in it. Maybe something like 
`ConcurrentQueue::consume_while(function(item)->bool)` could be implemented, 
where a `false` return value would indicate the `break` and that the item isn't 
poped out of the queue. My biggest issue with this approach is that I generally 
don't think that having a side-effect in a consumer lambda is good practise.
   
   I went with this design because it required the least modification and the 
performance is the same as before. I kinda agree that maybe leaving it as it 
was is fine.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to