omq-ffi 0.1.3 → 0.2.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 +4 -4
- data/lib/omq/ffi/engine.rb +11 -16
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 599fa43cae1f9008aeab639600df576eaa58a5de4a51ea2dfe346b0c0a6e3b39
|
|
4
|
+
data.tar.gz: 62bc52841f2f41fbec3307e9e79ba3a738a3a9b23198b675ce318632899eeb1e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 85d6866a99e6fd04cff9d8ba595b65f644c87c3f1af37fdab3d8974399d2fa40f19634f821236609c63425b87151a30ed48a5334f1d1033fbef81811520f118d
|
|
7
|
+
data.tar.gz: ec02b9b945b41ca1a0b5c39422f6a9a84f750630e290a6f93c8aac52dc31f66f4249b905caca96b789bc62f41a771aab41bcad503fdeb82eab96791cc5893730
|
data/lib/omq/ffi/engine.rb
CHANGED
|
@@ -208,11 +208,16 @@ module OMQ
|
|
|
208
208
|
|
|
209
209
|
|
|
210
210
|
# Captures the current Async task as the parent for I/O scheduling.
|
|
211
|
+
# +parent:+ is accepted for API compatibility with the pure-Ruby
|
|
212
|
+
# engine but has no effect: the FFI backend runs its own I/O
|
|
213
|
+
# thread and doesn't participate in the Async barrier tree.
|
|
211
214
|
#
|
|
212
215
|
# @return [void]
|
|
213
|
-
def capture_parent_task
|
|
216
|
+
def capture_parent_task(parent: nil)
|
|
214
217
|
return if @parent_task
|
|
215
|
-
if
|
|
218
|
+
if parent
|
|
219
|
+
@parent_task = parent
|
|
220
|
+
elsif Async::Task.current?
|
|
216
221
|
@parent_task = Async::Task.current
|
|
217
222
|
else
|
|
218
223
|
@parent_task = Reactor.root_task
|
|
@@ -237,22 +242,12 @@ module OMQ
|
|
|
237
242
|
|
|
238
243
|
# --- Recv ---
|
|
239
244
|
|
|
240
|
-
# Dequeues
|
|
245
|
+
# Dequeues the next received message, blocking until one is available.
|
|
241
246
|
#
|
|
242
|
-
# @
|
|
243
|
-
|
|
244
|
-
def dequeue_recv_batch(max)
|
|
247
|
+
# @return [Array<String>] multipart message
|
|
248
|
+
def dequeue_recv
|
|
245
249
|
ensure_io_thread
|
|
246
|
-
|
|
247
|
-
batch = [msg]
|
|
248
|
-
while batch.size < max
|
|
249
|
-
begin
|
|
250
|
-
batch << @recv_queue.pop(true)
|
|
251
|
-
rescue ThreadError
|
|
252
|
-
break
|
|
253
|
-
end
|
|
254
|
-
end
|
|
255
|
-
batch
|
|
250
|
+
wait_for_message
|
|
256
251
|
end
|
|
257
252
|
|
|
258
253
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omq-ffi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Patrik Wenger
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '0.
|
|
18
|
+
version: '0.17'
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '0.
|
|
25
|
+
version: '0.17'
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: ffi
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|