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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a98baec5b14b9cd623e2196eaf2ec1db08df41a
4
- data.tar.gz: 02919fe89d543b7771bcdbfbb77f08cfbfc5d467
3
+ metadata.gz: f0ff2a01e8c008418b2e2197c0ee87271c349673
4
+ data.tar.gz: 6fe0634414b78225c6c898da48d5a2793f96e0b1
5
5
  SHA512:
6
- metadata.gz: 9bb9c8afc5e2b491bb533f672667692a533f7d9639078e3d1b1e2f1996765d55449e3bfa25c5c3c72e7889f6b9ac5f61979ac191cfe7e79c02708460d4abcdb9
7
- data.tar.gz: 30445ba217eda5ff981d06f9a47197b995736ea0904f3fec155574bbdf6614264ce93933a3db7cb44f95f5cd51aad77386399d836b516ddddbcaf3189a248933
6
+ metadata.gz: 565e2ad3c3c35d84991b7cd2bd35bb326464506a8cc87a8c2e4b782d2b2808fa04d1d9a5a8466ddbd208718a169a148f69216e42f945326ffc77f5ce72b6f2b4
7
+ data.tar.gz: b39cdbb74ed2f2df86b354c2f3855a025d780c529cf0cff22e9e71339c44f37744e9c0e298320b01fe3f01d6640a38ef99c0543d247c1ace35c2eada0bbb7d05
@@ -7,6 +7,7 @@ require 'serfx/response'
7
7
  require 'serfx/commands'
8
8
  require 'serfx/exceptions'
9
9
  require 'socket'
10
+ require 'forwardable'
10
11
 
11
12
  module Serfx
12
13
  # This class wraps the low level msgpack data transformation and tcp
@@ -4,11 +4,12 @@ require 'json'
4
4
  module Serfx
5
5
  module Utils
6
6
 
7
- # serf event handler invocations are blocking calls. i.e. serf
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. due to this limitations long running tasks can not be
9
+ # in progress. Due to this limitations long running tasks can not be
10
10
  # orchestrated or invoked as serf handler directly.
11
- # [AsynchJob] address this by spawning the task as a background job,
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 [Hash]
84
+ # @return [String] JSON string representing current state of the task
84
85
  def state_info
85
86
  if exists?
86
- JSON.parse(File.read(state_file))
87
+ File.read(state_file)
87
88
  else
88
- {'status' => 'absent' }
89
+ JSON.generate(status: 'absent')
89
90
  end
90
91
  end
91
92
 
data/lib/serfx/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  #
3
3
  # Provides version as a contsant for the serf gem
4
4
  module Serfx
5
- VERSION = '0.0.3'
5
+ VERSION = '0.0.4'
6
6
  end
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.3
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-29 00:00:00.000000000 Z
11
+ date: 2014-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack