rabbitmq 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/rabbitmq/client/connection.rb +10 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bfa34be8651dfe3efcfeb6f154a75f737019936
|
4
|
+
data.tar.gz: 1586b65b879349e5240aebec45551cd0631b6939
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f0fae5f4d1ed711a1a3b8b0c7cc2385cc5b4318b66954cd3f1077c15367320337877d12e7e96da56811926190a012320b5bddcafd1c5015b9399b74ce4d9139
|
7
|
+
data.tar.gz: bbc35a0b0f0fbb85cbb78c767ecca4379b7bb1f93c7686f4ab5cd9447845a213436e0c90c2e4f95211c652dce9786b23a0b3224a2d03ab3379c5ce37a9a7ab2f
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
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
8
|
|
9
|
-
##### `$ gem install rabbitmq
|
9
|
+
##### `$ gem install rabbitmq`
|
10
10
|
|
11
11
|
## Design Goals
|
12
12
|
|
@@ -103,15 +103,19 @@ module RabbitMQ
|
|
103
103
|
@server_properties = FFI::Table.new(FFI.amqp_get_server_properties(@ptr)).to_h
|
104
104
|
end
|
105
105
|
|
106
|
+
# Calculate the amount of the timeout remaining from the given start time
|
107
|
+
def remaining_timeout(timeout=0, start=Time.now)
|
108
|
+
return nil unless timeout
|
109
|
+
timeout = timeout - (Time.now - start)
|
110
|
+
timeout < 0 ? 0 : timeout
|
111
|
+
end
|
112
|
+
|
106
113
|
# Block until there is readable data on the internal ruby socket,
|
107
114
|
# returning true if there is readable data, or false if time expired.
|
108
115
|
def select(timeout=0, start=Time.now)
|
109
|
-
|
110
|
-
timeout
|
111
|
-
|
112
|
-
end
|
113
|
-
|
114
|
-
IO.select([@ruby_socket], [], [], timeout) ? true : false
|
116
|
+
IO.select([@ruby_socket], [], [],
|
117
|
+
remaining_timeout(timeout, start)
|
118
|
+
) ? true : false
|
115
119
|
end
|
116
120
|
|
117
121
|
# Return the next available frame, or nil if time expired.
|