lifeguard 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,7 +14,16 @@ module Lifeguard
14
14
  return false if @shutdown
15
15
 
16
16
  if busy?
17
- block.call(*args) rescue nil
17
+ # Account for "weird" exceptions like Java Exceptions or higher up the chain
18
+ # than what `rescue nil` will capture
19
+ new_thread = ::Thread.new(block, args) do |callable, call_args|
20
+ ::Thread.current[:__start_time_in_seconds__] = Time.now.to_i
21
+ ::Thread.current.abort_on_exception = false
22
+
23
+ callable.call(*call_args)
24
+ end
25
+
26
+ ::Thread.pass while new_thread.alive?
18
27
  else
19
28
  super(*args, &block)
20
29
  end
@@ -27,18 +36,6 @@ module Lifeguard
27
36
  @shutdown = true
28
37
  end
29
38
 
30
- def on_thread_exit(thread)
31
- return_value = super
32
- check_queued_jobs
33
- return_value
34
- end
35
-
36
- def prune_busy_threads
37
- response = super
38
- check_queued_jobs
39
- response
40
- end
41
-
42
39
  def shutdown(*args)
43
40
  @shutdown = true
44
41
  super
@@ -1,3 +1,3 @@
1
1
  module Lifeguard
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lifeguard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Brian Stien
@@ -9,104 +10,118 @@ authors:
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2016-08-28 00:00:00.000000000 Z
13
+ date: 2016-09-08 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: better_receive
16
17
  requirement: !ruby/object:Gem::Requirement
18
+ none: false
17
19
  requirements:
18
- - - ">="
20
+ - - ! '>='
19
21
  - !ruby/object:Gem::Version
20
22
  version: '0'
21
23
  type: :development
22
24
  prerelease: false
23
25
  version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
24
27
  requirements:
25
- - - ">="
28
+ - - ! '>='
26
29
  - !ruby/object:Gem::Version
27
30
  version: '0'
28
31
  - !ruby/object:Gem::Dependency
29
32
  name: bundler
30
33
  requirement: !ruby/object:Gem::Requirement
34
+ none: false
31
35
  requirements:
32
- - - "~>"
36
+ - - ~>
33
37
  - !ruby/object:Gem::Version
34
38
  version: '1.5'
35
39
  type: :development
36
40
  prerelease: false
37
41
  version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
38
43
  requirements:
39
- - - "~>"
44
+ - - ~>
40
45
  - !ruby/object:Gem::Version
41
46
  version: '1.5'
42
47
  - !ruby/object:Gem::Dependency
43
48
  name: pry-nav
44
49
  requirement: !ruby/object:Gem::Requirement
50
+ none: false
45
51
  requirements:
46
- - - ">="
52
+ - - ! '>='
47
53
  - !ruby/object:Gem::Version
48
54
  version: '0'
49
55
  type: :development
50
56
  prerelease: false
51
57
  version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
52
59
  requirements:
53
- - - ">="
60
+ - - ! '>='
54
61
  - !ruby/object:Gem::Version
55
62
  version: '0'
56
63
  - !ruby/object:Gem::Dependency
57
64
  name: rake
58
65
  requirement: !ruby/object:Gem::Requirement
66
+ none: false
59
67
  requirements:
60
- - - ">="
68
+ - - ! '>='
61
69
  - !ruby/object:Gem::Version
62
70
  version: '0'
63
71
  type: :development
64
72
  prerelease: false
65
73
  version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
66
75
  requirements:
67
- - - ">="
76
+ - - ! '>='
68
77
  - !ruby/object:Gem::Version
69
78
  version: '0'
70
79
  - !ruby/object:Gem::Dependency
71
80
  name: rspec
72
81
  requirement: !ruby/object:Gem::Requirement
82
+ none: false
73
83
  requirements:
74
- - - ">="
84
+ - - ! '>='
75
85
  - !ruby/object:Gem::Version
76
86
  version: '0'
77
87
  type: :development
78
88
  prerelease: false
79
89
  version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
80
91
  requirements:
81
- - - ">="
92
+ - - ! '>='
82
93
  - !ruby/object:Gem::Version
83
94
  version: '0'
84
95
  - !ruby/object:Gem::Dependency
85
96
  name: rspec-pride
86
97
  requirement: !ruby/object:Gem::Requirement
98
+ none: false
87
99
  requirements:
88
- - - ">="
100
+ - - ! '>='
89
101
  - !ruby/object:Gem::Version
90
102
  version: '0'
91
103
  type: :development
92
104
  prerelease: false
93
105
  version_requirements: !ruby/object:Gem::Requirement
106
+ none: false
94
107
  requirements:
95
- - - ">="
108
+ - - ! '>='
96
109
  - !ruby/object:Gem::Version
97
110
  version: '0'
98
111
  - !ruby/object:Gem::Dependency
99
112
  name: simplecov
100
113
  requirement: !ruby/object:Gem::Requirement
114
+ none: false
101
115
  requirements:
102
- - - ">="
116
+ - - ! '>='
103
117
  - !ruby/object:Gem::Version
104
118
  version: '0'
105
119
  type: :development
106
120
  prerelease: false
107
121
  version_requirements: !ruby/object:Gem::Requirement
122
+ none: false
108
123
  requirements:
109
- - - ">="
124
+ - - ! '>='
110
125
  - !ruby/object:Gem::Version
111
126
  version: '0'
112
127
  description: Do you have a threadpool? Do you need someone to watch it? Look no further!
@@ -117,9 +132,9 @@ executables: []
117
132
  extensions: []
118
133
  extra_rdoc_files: []
119
134
  files:
120
- - ".gitignore"
121
- - ".rspec"
122
- - ".travis.yml"
135
+ - .gitignore
136
+ - .rspec
137
+ - .travis.yml
123
138
  - Gemfile
124
139
  - LICENSE.txt
125
140
  - README.md
@@ -137,26 +152,33 @@ files:
137
152
  homepage: https://github.com/moneydesktop/lifeguard
138
153
  licenses:
139
154
  - MIT
140
- metadata: {}
141
155
  post_install_message:
142
156
  rdoc_options: []
143
157
  require_paths:
144
158
  - lib
145
159
  required_ruby_version: !ruby/object:Gem::Requirement
160
+ none: false
146
161
  requirements:
147
- - - ">="
162
+ - - ! '>='
148
163
  - !ruby/object:Gem::Version
149
164
  version: '0'
165
+ segments:
166
+ - 0
167
+ hash: -402206971017755019
150
168
  required_rubygems_version: !ruby/object:Gem::Requirement
169
+ none: false
151
170
  requirements:
152
- - - ">="
171
+ - - ! '>='
153
172
  - !ruby/object:Gem::Version
154
173
  version: '0'
174
+ segments:
175
+ - 0
176
+ hash: -402206971017755019
155
177
  requirements: []
156
178
  rubyforge_project:
157
- rubygems_version: 2.5.1
179
+ rubygems_version: 1.8.24
158
180
  signing_key:
159
- specification_version: 4
181
+ specification_version: 3
160
182
  summary: A Supervised threadpool implementation in ruby.
161
183
  test_files:
162
184
  - spec/lifeguard/reaper_spec.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 0eb6d0a050c5e7f9abcaa0f84b59771c1279c61a
4
- data.tar.gz: f2d0829c7284be531a1141deb69cc21fa2e2c926
5
- SHA512:
6
- metadata.gz: 062da13fa9b240289439a23f71d39c0c8a6b308331c4fdcb231962ed30fdeb0d17aa33b2acae0a15d5fef15f57d23a797fde9e9cc5784dc966403f934cb2f2c7
7
- data.tar.gz: b6ff5d59113351955ff6ca80b1a6810ba3d6d275f42a86de5f6200a63023411b9a246a3cb975146b9f7fda54b50b4dde9cf4e594034732ec110611b9e1958b70