serfx 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/serfx/connection.rb +1 -0
- data/lib/serfx/utils/async_job.rb +7 -6
- data/lib/serfx/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0ff2a01e8c008418b2e2197c0ee87271c349673
|
4
|
+
data.tar.gz: 6fe0634414b78225c6c898da48d5a2793f96e0b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 565e2ad3c3c35d84991b7cd2bd35bb326464506a8cc87a8c2e4b782d2b2808fa04d1d9a5a8466ddbd208718a169a148f69216e42f945326ffc77f5ce72b6f2b4
|
7
|
+
data.tar.gz: b39cdbb74ed2f2df86b354c2f3855a025d780c529cf0cff22e9e71339c44f37744e9c0e298320b01fe3f01d6640a38ef99c0543d247c1ace35c2eada0bbb7d05
|
data/lib/serfx/connection.rb
CHANGED
@@ -4,11 +4,12 @@ require 'json'
|
|
4
4
|
module Serfx
|
5
5
|
module Utils
|
6
6
|
|
7
|
-
#
|
7
|
+
# Serf event handler invocations are blocking calls. i.e. serf
|
8
8
|
# will not process any other event when a handler invocation is
|
9
|
-
# in progress.
|
9
|
+
# in progress. Due to this limitations long running tasks can not be
|
10
10
|
# orchestrated or invoked as serf handler directly.
|
11
|
-
#
|
11
|
+
#
|
12
|
+
# AsynchJob address this by spawning the task as a background job,
|
12
13
|
# allowing the handler code to return immediately. It does double fork
|
13
14
|
# where the first child process is detached (attached to init as parent
|
14
15
|
# process) and spawn the second child process with the target,
|
@@ -80,12 +81,12 @@ module Serfx
|
|
80
81
|
|
81
82
|
# obtain current state information about the task
|
82
83
|
#
|
83
|
-
# @return [
|
84
|
+
# @return [String] JSON string representing current state of the task
|
84
85
|
def state_info
|
85
86
|
if exists?
|
86
|
-
|
87
|
+
File.read(state_file)
|
87
88
|
else
|
88
|
-
|
89
|
+
JSON.generate(status: 'absent')
|
89
90
|
end
|
90
91
|
end
|
91
92
|
|
data/lib/serfx/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serfx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rnjib Dey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|