octokiq 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: 8759493bef58bcafe233d6af07ecb747e11aa9f12c285f60082cf3307ce5db6b
4
- data.tar.gz: bbbe753f9257e51ea311b3da039b5bfd0573a9a3a1d94353b5550717d5971578
3
+ metadata.gz: f28e37cf9c233c23e2bd805a66f09499ab4f7076e8a6275576aa119c3f16f374
4
+ data.tar.gz: 12a6f510c04659f8bb636bf3e1f687efb798c8a365ef227c4b0a5ba3d2082848
5
5
  SHA512:
6
- metadata.gz: e135d55a8e6dde10b680241f27a98979d8d61d928d45c3f2c6747fee57d1af4f9bab53ae313f85999669a03974fb557a219dc21cffba24e8aab3343eb68fb28a
7
- data.tar.gz: b8f8c68a12044e897a0d8bf6218bd56068c458371c92de891635dd7465cccc95b41127e3ab0b56bd2d6fcf08e3c1ddd927cc1fbfedce38aa9a800f6bdccaf0ac
6
+ metadata.gz: 343e6dbfb7161aa9dbf0aee8006176073f814d838d2387127e99a498cba5dabc42b7df1b632687486382e4caebd509b3296020492eb4943c1bf01f71df990282
7
+ data.tar.gz: 92f38623fec01098154151acf6d13af9210cd117185871d2372cf25d246d704cf4202d5f985233f039caa70ba88b1207c2ff8488eb87a7b64db13acc713e8d61
@@ -7,4 +7,9 @@ Initial release 🚀
7
7
  ## 0.1.1 - 2020-12-30
8
8
 
9
9
  - Replace worker class configuration `queue` with `octokiq_options`
10
- - Enable non-ractor safe job running with traditional `Thread`
10
+ - Enable non-ractor safe job running with traditional `Thread`
11
+
12
+ ## 0.1.2 - 2020-12-30
13
+
14
+ - Fix the ractor server loop bug
15
+ - Add configuration `force_thread_mode`
@@ -3,13 +3,15 @@ module Octokiq
3
3
  attr_accessor :processors_count,
4
4
  :queue_prefix,
5
5
  :default_queue,
6
- :queues
6
+ :queues,
7
+ :force_thread_mode
7
8
 
8
9
  def initialize
9
10
  @processors_count = Etc.nprocessors
10
11
  @queue_prefix = 'octokiq'
11
12
  @default_queue = 'default'
12
13
  @queues = [@default_queue]
14
+ @force_thread_mode = false
13
15
  end
14
16
  end
15
17
  end
@@ -6,7 +6,7 @@ module Octokiq
6
6
 
7
7
  loop do
8
8
  job = Octokiq.server_connection.fetch(queues)
9
- pipe << job
9
+ Octokiq.configuration.force_thread_mode ? tube << job : pipe << job
10
10
  end
11
11
  end
12
12
 
@@ -15,12 +15,14 @@ module Octokiq
15
15
  def handle_pipe
16
16
  (1..Octokiq.configuration.processors_count).map do
17
17
  Ractor.new(pipe, tube) do |pipe, tube|
18
- job = pipe.take
19
- begin
20
- Processor.new(job).run
21
- rescue Ractor::IsolationError => e
22
- Octokiq.logger.warn 'Ractor::IsolationError'
23
- tube << job
18
+ loop do
19
+ job = pipe.take
20
+ begin
21
+ Processor.new(job).run
22
+ rescue Ractor::IsolationError => e
23
+ Octokiq.logger.warn 'Ractor::IsolationError'
24
+ tube << job
25
+ end
24
26
  end
25
27
  end
26
28
  end
@@ -1,3 +1,3 @@
1
1
  module Octokiq
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octokiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bran Liang