public async Task TestReserveReleaseConsume() { var b2 = new BatchedJoinBlock <int, int>(2); b2.Target1.Post(1); b2.Target2.Post(2); await DataflowTestHelpers.TestReserveAndRelease(b2); b2 = new BatchedJoinBlock <int, int>(2); b2.Target1.Post(1); b2.Target2.Post(2); await DataflowTestHelpers.TestReserveAndConsume(b2); var b3 = new BatchedJoinBlock <int, int, int>(1); b3.Target2.Post(3); await DataflowTestHelpers.TestReserveAndRelease(b3); b3 = new BatchedJoinBlock <int, int, int>(4); b3.Target3.Post(1); b3.Target3.Post(2); b3.Target3.Post(3); b3.Target2.Post(3); await DataflowTestHelpers.TestReserveAndConsume(b3); }
public async Task TestReserveReleaseConsume() { var wb = new WriteOnceBlock <int>(i => i * 2); wb.Post(1); await DataflowTestHelpers.TestReserveAndRelease(wb, reservationIsTargetSpecific : false); wb = new WriteOnceBlock <int>(i => i * 2); wb.Post(2); await DataflowTestHelpers.TestReserveAndConsume(wb, reservationIsTargetSpecific : false); }
public async Task TestReserveReleaseConsume() { var bb = new BroadcastBlock <int>(i => i * 2); bb.Post(1); await DataflowTestHelpers.TestReserveAndRelease(bb, reservationIsTargetSpecific : false); bb = new BroadcastBlock <int>(i => i * 2); bb.Post(2); await DataflowTestHelpers.TestReserveAndConsume(bb, reservationIsTargetSpecific : false); }
public async Task TestReserveReleaseConsume() { var bb = new BufferBlock <int>(); bb.Post(1); await DataflowTestHelpers.TestReserveAndRelease(bb); bb = new BufferBlock <int>(); bb.Post(2); await DataflowTestHelpers.TestReserveAndConsume(bb); }
public async Task TestReserveReleaseConsume() { var tb = new TransformBlock <int, int>(i => i * 2); tb.Post(1); await DataflowTestHelpers.TestReserveAndRelease(tb); tb = new TransformBlock <int, int>(i => i * 2); tb.Post(2); await DataflowTestHelpers.TestReserveAndConsume(tb); }
public async Task TestReserveReleaseConsume() { var bb = new BatchBlock <int>(2); bb.PostItems(1, 2); await DataflowTestHelpers.TestReserveAndRelease(bb); bb = new BatchBlock <int>(2); bb.PostItems(1, 2); await DataflowTestHelpers.TestReserveAndConsume(bb); }