toiler 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e7d2dcf6782c8da2ea8e2c717aad6fd239ca3f3
4
- data.tar.gz: 187fec94a6654eb47e615fc34d648b10276367eb
3
+ metadata.gz: b5094f14a48bb93a3fc011131d90b99d1efbc65b
4
+ data.tar.gz: b8a2aad41830c1386e7e80f88bb23bc93ae8090e
5
5
  SHA512:
6
- metadata.gz: 2d13efd4d0257ca6a332386fbbbf85a434233c17020edbee852261c6df09f967ffd220b74416a1266496c8ff0e78297478bc2afd41a39b034d5666f4e0c14c1e
7
- data.tar.gz: 2c1736df61af8214cbfee1d430771509646ead0de0d52279ef4aaf3de9a6d39219e18f2dd2bc2a84eb7e04f136ff101230716660964db7c3ac47d88ddc313389
6
+ metadata.gz: 0abd85e8597d0777923e5c918579aee7225fdfe806ac549d01d8a662969d001855a1dd65ce5bdc65fb255dbf6651bede1766dfb3f5493a10a9d5f16f7476e6e7
7
+ data.tar.gz: 09347dbc2a2946db435387221163bf8bf03e92604ddd5e6fb7cdcee39a63ec089af5befb8dda6ee5e96825301b74b90bac10b64268235344ca61712e25e8fdbc
@@ -5,6 +5,8 @@ module Toiler
5
5
  module Actor
6
6
  # Actor that starts and supervises Toiler's actors
7
7
  class Supervisor < Concurrent::Actor::RestartingContext
8
+ include Utils::ActorLogging
9
+
8
10
  attr_accessor :client
9
11
 
10
12
  def initialize
@@ -23,9 +25,13 @@ module Toiler
23
25
 
24
26
  def spawn_fetchers
25
27
  queues.each do |queue, _klass|
26
- fetcher = Actor::Fetcher.spawn! name: "fetcher_#{queue}".to_sym,
27
- supervise: true, args: [queue, client]
28
- Toiler.set_fetcher queue, fetcher
28
+ begin
29
+ fetcher = Actor::Fetcher.spawn! name: "fetcher_#{queue}".to_sym,
30
+ supervise: true, args: [queue, client]
31
+ Toiler.set_fetcher queue, fetcher
32
+ rescue StandardError => e
33
+ error "Failed to start Fetcher for queue #{queue}: #{e.message}\n#{e.backtrace.join("\n")}"
34
+ end
29
35
  end
30
36
  end
31
37
 
@@ -33,11 +39,15 @@ module Toiler
33
39
  queues.each do |queue, klass|
34
40
  name = "processor_pool_#{queue}".to_sym
35
41
  count = klass.concurrency
36
- pool = Concurrent::Actor::Utils::Pool.spawn! name, count do |index|
37
- Actor::Processor.spawn name: "processor_#{queue}_#{index}".to_sym,
38
- supervise: true, args: [queue]
42
+ begin
43
+ pool = Concurrent::Actor::Utils::Pool.spawn! name, count do |index|
44
+ Actor::Processor.spawn name: "processor_#{queue}_#{index}".to_sym,
45
+ supervise: true, args: [queue]
46
+ end
47
+ Toiler.set_processor_pool queue, pool
48
+ rescue StandardError => e
49
+ error "Failed to spawn Processor Pool for queue #{queue}: #{e.message}\n#{e.backtrace.join("\n")}"
39
50
  end
40
- Toiler.set_processor_pool queue, pool
41
51
  end
42
52
  end
43
53
  end
@@ -1,4 +1,4 @@
1
1
  # Toiler Version
2
2
  module Toiler
3
- VERSION = '0.2.4'
3
+ VERSION = '0.2.5'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Schepens
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-25 00:00:00.000000000 Z
11
+ date: 2016-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler