From e4a0f5dc2d17bb8b1d822742e9a7a31d4de7abbf Mon Sep 17 00:00:00 2001 From: tan Date: Tue, 27 Sep 2016 19:30:45 +0530 Subject: [PATCH] fix bit field concat --- src/types.jl | 2 +- test/test_throughput.jl | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/types.jl b/src/types.jl index 1568974..24562f2 100644 --- a/src/types.jl +++ b/src/types.jl @@ -34,7 +34,7 @@ function TAMQPBit(b::TAMQPBit, pos::Int) end function TAMQPBit(b::TAMQPBit, setbit::TAMQPBit, pos::Int) - TAMQPBit(b.val & (setbit.val << (pos-1))) + TAMQPBit(b.val | (setbit.val << (pos-1))) end immutable TAMQPDecimalValue diff --git a/test/test_throughput.jl b/test/test_throughput.jl index 8faf136..2cd82fa 100644 --- a/test/test_throughput.jl +++ b/test/test_throughput.jl @@ -8,6 +8,7 @@ const QUEUE1 = "queue1" const ROUTE1 = "key1" const MSG_SIZE = 1024 const NMSGS = 10^6 +const no_ack = true const M = Message(rand(UInt8, 1024), content_type="application/octet-stream", delivery_mode=PERSISTENT) @@ -64,7 +65,7 @@ function publish(conn, chan1) basic_publish(chan1, M; exchange=EXCG_DIRECT, routing_key=ROUTE1) if (idx % 10000) == 0 println("publishing $idx ...") - sleep(2) + sleep(1) end end end @@ -83,12 +84,12 @@ function consume(conn, chan1) #basic_ack(chan1, 0; all_upto=true) println("ack sent $msg_count ...") end - basic_ack(chan1, rcvd_msg.delivery_tag) + no_ack || basic_ack(chan1, rcvd_msg.delivery_tag) if msg_count == NMSGS end_time = time() end end - success, consumer_tag = basic_consume(chan1, QUEUE1, consumer_fn) + success, consumer_tag = basic_consume(chan1, QUEUE1, consumer_fn; no_ack=no_ack) @test success # wait to receive all messages