concurrent_worker 0.3.0 → 0.3.1
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/Gemfile.lock +1 -1
- data/lib/concurrent_worker/version.rb +1 -1
- data/lib/concurrent_worker.rb +11 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b87c721ec0afe8f8cc7a63e2f966b15f3ec7ee3afe7b9bca92318efb4b21f6db
|
4
|
+
data.tar.gz: b04acf17b575e0f0b2b0b00bc0ae93c2c05714fb472bf2ea184b651061974380
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67caefcf14850a02e930b4379976d80c6616cf1d7232b5296bf51653897e3034e401d1cca12b5606f74f43d2abd5fbfef6a504a83c10c91047aa9167529c53cc
|
7
|
+
data.tar.gz: d41da169a6d9d419fc0b15973d551881d4535fcd308b0920a5e4c45289b0444d7ce277918a86396ed89c8c381713bc3f72fbad1b136a8a3a9510c275acc58581
|
data/Gemfile.lock
CHANGED
data/lib/concurrent_worker.rb
CHANGED
@@ -375,7 +375,7 @@ module ConcurrentWorker
|
|
375
375
|
loop do
|
376
376
|
break if (result = @rcv_queue.pop).empty?
|
377
377
|
@result_callbacks.each do |callback|
|
378
|
-
callback.call(*result
|
378
|
+
callback.call(*result)
|
379
379
|
end
|
380
380
|
@req_counter.pop
|
381
381
|
end
|
@@ -421,16 +421,20 @@ module ConcurrentWorker
|
|
421
421
|
defined?(@work_block) || @work_block = nil
|
422
422
|
w = Worker.new(*@args, type: @options[:type], snd_queue_max: @snd_queue_max, &@work_block)
|
423
423
|
w.add_callback do |*arg|
|
424
|
-
|
425
|
-
|
424
|
+
Thread.handle_interrupt(Object => :never) do
|
425
|
+
@rcv_queue.push(arg)
|
426
|
+
@ready_queue.push(w)
|
427
|
+
end
|
426
428
|
end
|
427
429
|
|
428
430
|
w.add_retired_callback do
|
429
|
-
|
430
|
-
|
431
|
-
|
431
|
+
Thread.handle_interrupt(Object => :never) do
|
432
|
+
w.req_counter.rest.each do
|
433
|
+
|req|
|
434
|
+
@snd_queue.push(req)
|
435
|
+
end
|
436
|
+
@ready_queue.push(w)
|
432
437
|
end
|
433
|
-
@ready_queue.push(w)
|
434
438
|
end
|
435
439
|
|
436
440
|
@set_blocks.each do |symbol, block|
|