Closed roback closed 8 years ago
close #4
Added a class for subscribing to queues. The code is roughly the same as in chapman and zambezi.
Tested it by using rabbitmqadmin:
rabbitmqadmin
$ rabbitmqadmin declare exchange name=binlog-test type=topic $ bundle console > s = Twingly::AMQP::Subscription.new(queue_name: "testing-twingly-amqp", routing_key: "testing.#", exchange_topic: "binlog-test") > s.subscribe do |message| > puts message > end
$ rabbitmqadmin publish exchange=binlog-test routing_key="testing.test" payload='{"message": "hello!"}'
Tests for this would be nice, but I don't know how to do. I don't know how you should test Subscription#subscribe since it blocks the starting thread.
Subscription#subscribe
I'm finished with this one. I'll add tests for this and #ping in another branch instead of doing it here.
#ping
Ah, forgot to say so, but it looked good to me :)
:+1:
close #4
Added a class for subscribing to queues. The code is roughly the same as in chapman and zambezi.
Tested it by using
rabbitmqadmin
:Tests for this would be nice, but I don't know how to do. I don't know how you should test
Subscription#subscribe
since it blocks the starting thread.