New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TestKit ReceiveWhile did not insert last inspected message properly. #5092
TestKit ReceiveWhile did not insert last inspected message properly. #5092
Conversation
@@ -22,7 +22,7 @@ namespace Akka.TestKit.Internal | |||
/// <typeparam name="T">The type of item to store.</typeparam> | |||
public class BlockingQueue<T> | |||
{ | |||
private readonly BlockingCollection<Positioned> _collection = new BlockingCollection<Positioned>(); | |||
private readonly BlockingCollection<Positioned> _collection = new BlockingCollection<Positioned>(new QueueWithAddFirst()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QueueWithAddFirst
is the backing IProducerConsumerCollection
for the internal BlockingCollection
that allows proper item insertion in the head of the queue.
…ub.com:Arkatufus/akka.net into Fix_ReceiveWhile_did_not_insert_items_properly
…rks as intended" This reverts commit 09ece29.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - looks like we should have been using that positional queue this entire time.
While peeking through items inside the backing
BlockingCollection
, ReceiveWhile re-insert the last item it inspected in the last position instead of the first.