thread_watcher 0.9.0 → 1.0.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/README.md +8 -7
- data/lib/thread_watcher/process_watch.rb +3 -3
- data/lib/thread_watcher/thread_holder.rb +3 -3
- data/lib/thread_watcher/version.rb +1 -1
- data/lib/thread_watcher.rb +0 -5
- data/thread_watcher.gemspec +2 -2
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f43a2fa0ddd026933d5db0a46dddd567cdc1a58d
|
4
|
+
data.tar.gz: a701a0b0a633cdfa81d676d859e05ce42d44fb7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b001e06a3fcb58f24673ab77af6e9e61fabffa1786dc0f8a90b32ac069f14ac15ace26f27c740d0b3b2d8e2016ce670a4e925453d89c36cce180177605b58004
|
7
|
+
data.tar.gz: 6d4a65d215975df9217c9ad892eac1a32074880406ce964771ac576420aa34ef693c4997340fa5ec693c9463f35307eec3fe85da9c47c710140c15204e56a2a1
|
data/README.md
CHANGED
@@ -2,15 +2,16 @@
|
|
2
2
|
|
3
3
|
You need to monitor some big background tasks and kill one specific thread or restart them after scheduling in another part of your application. This Gem put each task in a separate thread, which you can start, stop or restart.
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
## Important
|
6
|
+
If you really need a Version which is working with ruby 1.8.7 switch to [ThreadWatcher Version 0.9.0](https://github.com/robst/thread_watcher/tree/v0.9.0)
|
7
|
+
Ruby 1.8.7 support removed in Version 1.0.0
|
7
8
|
|
8
9
|
## Installation
|
9
10
|
|
10
11
|
hm, yeah. just add this to your Gemfile:
|
11
12
|
|
12
13
|
```ruby
|
13
|
-
gem 'thread_watcher', '~> 0.
|
14
|
+
gem 'thread_watcher', '~> 1.0.0'
|
14
15
|
```
|
15
16
|
|
16
17
|
And then execute:
|
@@ -26,14 +27,14 @@ Huh, ready to use!
|
|
26
27
|
|
27
28
|
## Usage
|
28
29
|
|
29
|
-
Ok, let's say you want to run a big process separatly in a thread.
|
30
|
-
Something big like sleep(10) ;).
|
30
|
+
Ok, let's say you want to run a big process separatly in a thread.
|
31
|
+
Something big like sleep(10) ;).
|
31
32
|
|
32
33
|
```ruby
|
33
34
|
ThreadWatcher::Monitor.run { sleep 10 }
|
34
35
|
```
|
35
36
|
|
36
|
-
Run needs a block to work and return the internal process id.
|
37
|
+
Run needs a block to work and return the internal process id.
|
37
38
|
This could be something like `1452333019`
|
38
39
|
|
39
40
|
If your thread is ok, so let them work.
|
@@ -131,4 +132,4 @@ If you have further questions, code smells, hints or a beer, just contact me :)
|
|
131
132
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
132
133
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
133
134
|
4. Push to the branch (`git push origin my-new-feature`)
|
134
|
-
5. Create a new Pull Request
|
135
|
+
5. Create a new Pull Request
|
@@ -52,8 +52,8 @@ module ThreadWatcher
|
|
52
52
|
private
|
53
53
|
|
54
54
|
def start_cleaning_job
|
55
|
-
run(:
|
55
|
+
run(name: 'Cleaning Jobs', keep_alive: true) { while true; self.clear!; sleep(60); end; }
|
56
56
|
end
|
57
|
-
|
57
|
+
|
58
58
|
end
|
59
|
-
end
|
59
|
+
end
|
@@ -15,7 +15,7 @@ module ThreadWatcher
|
|
15
15
|
def stop!
|
16
16
|
@thread.kill
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
def restart!
|
20
20
|
stop!
|
21
21
|
start!
|
@@ -36,7 +36,7 @@ module ThreadWatcher
|
|
36
36
|
private
|
37
37
|
|
38
38
|
def available_options
|
39
|
-
{ :
|
39
|
+
{ name: :noname, keep_alive: false }
|
40
40
|
end
|
41
41
|
|
42
42
|
def initialize_starttime
|
@@ -47,4 +47,4 @@ module ThreadWatcher
|
|
47
47
|
@id = start_time || time_to_i
|
48
48
|
end
|
49
49
|
end
|
50
|
-
end
|
50
|
+
end
|
data/lib/thread_watcher.rb
CHANGED
data/thread_watcher.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
|
12
12
|
|
13
13
|
spec.summary = %q{Monitor Tasks and kill or restart them from each Point of your Application.}
|
14
|
-
spec.description = %q{You need to monitor some big background tasks and kill one specific thread or restart them after scheduling in another part of your application? Then this Gem could be usefull for you.
|
14
|
+
spec.description = %q{You need to monitor some big background tasks and kill one specific thread or restart them after scheduling in another part of your application? Then this Gem could be usefull for you. See detailed information at the github Page.}
|
15
15
|
spec.homepage = "https://github.com/robst/thread_watcher"
|
16
16
|
spec.license = "MIT"
|
17
17
|
|
@@ -23,5 +23,5 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.8"
|
24
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
25
25
|
|
26
|
-
spec.required_ruby_version = '>=
|
26
|
+
spec.required_ruby_version = '>= 2.0.0'
|
27
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thread_watcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Starke
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -40,8 +40,7 @@ dependencies:
|
|
40
40
|
version: '10.0'
|
41
41
|
description: You need to monitor some big background tasks and kill one specific thread
|
42
42
|
or restart them after scheduling in another part of your application? Then this
|
43
|
-
Gem could be usefull for you.
|
44
|
-
than 1.8.7. See detailed information at the github Page.
|
43
|
+
Gem could be usefull for you. See detailed information at the github Page.
|
45
44
|
email:
|
46
45
|
- robertst81@gmail.com
|
47
46
|
executables: []
|
@@ -75,7 +74,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
75
74
|
requirements:
|
76
75
|
- - ">="
|
77
76
|
- !ruby/object:Gem::Version
|
78
|
-
version:
|
77
|
+
version: 2.0.0
|
79
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
79
|
requirements:
|
81
80
|
- - ">="
|