public void QueueSink_should_allow_to_have_only_one_future_waiting_for_result_in_each_point_in_time()
{
this.AssertAllStagesStopped(() =>
{
var probe = TestPublisher.CreateManualProbe<int>(this);
var queue = Source.FromPublisher(probe).RunWith(Sink.Queue<int>(), _materializer);
var sub = probe.ExpectSubscription();
var future = queue.PullAsync();
var future2 = queue.PullAsync();
future2.Invoking(t => t.Wait(TimeSpan.FromMilliseconds(300))).ShouldThrow<IllegalStateException>();
sub.SendNext(1);
future.PipeTo(TestActor);
ExpectMsg(new Option<int>(1));
sub.SendComplete();
queue.PullAsync();
}, _materializer);
}