rabbitmq 1.0.0.pre.pre → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bbcea6833e05f45e3fad47a964344db56b8b35e4
4
- data.tar.gz: df9d1eada5b15a428b2f40534c4b1ca19871545b
3
+ metadata.gz: 22054636153b22c167c3ad8d50e9f613d23c7af6
4
+ data.tar.gz: 127d9e3cb05f29f76f4c74dd3be37cd64a5e1f0a
5
5
  SHA512:
6
- metadata.gz: 7c555f53f68264cdabc58c23bd4222d6771f33c6841a74efe28c448a653cb51dbbee3e5d8c12279c9c96ad82114a6473d1a91790c21d4b7e34d5123a8822bf82
7
- data.tar.gz: 7a041a8493561c0b10eab3c7d7133047e67f404925ec5e17a2c22832cec92846ca0b05326397039c5f203c2400185466024921a1d1f6b52dcb22136506a0167b
6
+ metadata.gz: dead99ee2adae3bb510d5adfe15c66c973cf4a70b9faee176af1e4ef71870e49b0c29406b7c1ce319f993de8414dfae94ec5dc7474c8f0c2409063e82e16ff61
7
+ data.tar.gz: 4bba178bb2a19e0715927f0756bfeaf833da7bcc3a53417c691110881d7a7399b42779a61f78fa5e3ce8723dd4ed5499374297668fe7ca4dc1e176ba34f26f9e
data/README.md CHANGED
@@ -1,9 +1,12 @@
1
1
  # rabbitmq
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/rabbitmq.png)](http://badge.fury.io/rb/rabbitmq)
4
- [![Build Status](https://circleci.com/gh/jemc/ruby-rabbitmq/tree/master.svg?style=svg)](https://circleci.com/gh/jemc/ruby-rabbitmq/tree/master)
3
+ [![Build Status](https://circleci.com/gh/jemc/ruby-rabbitmq/tree/master.svg?style=svg)](https://circleci.com/gh/jemc/ruby-rabbitmq/tree/master)
4
+ [![Gem Version](https://badge.fury.io/rb/rabbitmq.png)](http://badge.fury.io/rb/rabbitmq)
5
+ [![Join the chat at https://gitter.im/jemc/ruby-rabbitmq](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jemc/ruby-rabbitmq?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5
6
 
6
- A Ruby RabbitMQ client library based on FFI bindings for librabbitmq.
7
+ A Ruby [RabbitMQ](https://www.rabbitmq.com/features.html) client library based on [FFI](https://github.com/ffi/ffi/wiki) bindings for [librabbitmq](https://github.com/alanxz/rabbitmq-c).
8
+
9
+ ##### `$ gem install rabbitmq -v 1.0.0-pre`
7
10
 
8
11
  ## Design Goals
9
12
 
@@ -24,19 +27,16 @@ This library does not provide thread-safe client objects. Multithreaded applicat
24
27
 
25
28
  ## Usage
26
29
 
27
- ```bash
28
- gem install rabbitmq
29
- ruby examples/publish_500.rb
30
- ruby examples/consume_500.rb
31
- ```
30
+ To use this library effectively, it is necessary to understand the possibilities and idioms of RabbitMQ. Users are encouraged to familiarize themselves with the [AMQP protocol reference documentation](http://www.rabbitmq.com/amqp-0-9-1-reference.html).
32
31
 
32
+ ##### `$ ruby examples/publish_500.rb`
33
33
  ```ruby
34
- # examples/publish_500.rb
35
34
  require 'rabbitmq'
36
35
 
37
36
  publisher = RabbitMQ::Client.new.start.channel
38
37
  queue = "some_queue"
39
38
  exchange = "" # default exchange
39
+ publisher.queue_delete(queue)
40
40
  publisher.queue_declare(queue)
41
41
 
42
42
  500.times do |i|
@@ -44,13 +44,14 @@ publisher.queue_declare(queue)
44
44
  end
45
45
  ```
46
46
 
47
+ ##### `$ ruby examples/consume_500.rb`
47
48
  ```ruby
48
- # examples/consume_500.rb
49
49
  require 'rabbitmq'
50
50
 
51
51
  consumer = RabbitMQ::Client.new.start.channel
52
52
  consumer.basic_qos(prefetch_count: 500)
53
- consumer.basic_consume("some_queue")
53
+ res = consumer.basic_consume("some_queue")
54
+ tag = res[:properties][:consumer_tag]
54
55
 
55
56
  count = 0
56
57
  consumer.on :basic_deliver do |message|
@@ -62,6 +63,7 @@ consumer.on :basic_deliver do |message|
62
63
  end
63
64
 
64
65
  consumer.run_loop!
66
+ consumer.basic_cancel(tag)
65
67
  ```
66
68
 
67
69
  ## Contributing
@@ -300,8 +300,6 @@ module RabbitMQ
300
300
 
301
301
  # Internal implementation of the {#run_loop!} method.
302
302
  private def fetch_events(timeout=protocol_timeout, start=Time.now)
303
- @conn.garbage_collect
304
-
305
303
  while (event = @conn.fetch_next_event(timeout, start))
306
304
  handle_incoming_event(event)
307
305
  store_incoming_event(event)
@@ -317,8 +315,6 @@ module RabbitMQ
317
315
  return found if found
318
316
  }
319
317
 
320
- @conn.garbage_collect_channel(channel_id)
321
-
322
318
  while (event = @conn.fetch_next_event(timeout, start))
323
319
  handle_incoming_event(event)
324
320
  return event if channel_id == event.fetch(:channel) \
@@ -137,6 +137,8 @@ module RabbitMQ
137
137
  # Fetch the next one or more frames to form the next discrete event,
138
138
  # returning the event as a Hash, or nil if time expired.
139
139
  def fetch_next_event(timeout=0, start=Time.now)
140
+ garbage_collect
141
+
140
142
  frame = fetch_next_frame(timeout, start)
141
143
  return unless frame
142
144
  event = frame.as_method_to_h(false)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabbitmq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.pre
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe McIlvain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-12 00:00:00.000000000 Z
11
+ date: 2015-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -222,9 +222,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
222
222
  version: '0'
223
223
  required_rubygems_version: !ruby/object:Gem::Requirement
224
224
  requirements:
225
- - - ">"
225
+ - - ">="
226
226
  - !ruby/object:Gem::Version
227
- version: 1.3.1
227
+ version: '0'
228
228
  requirements: []
229
229
  rubyforge_project:
230
230
  rubygems_version: 2.2.2