leofs_manager_client 0.2.4 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -62,7 +62,7 @@ module LeoFSManager
62
62
  # Node Status Model
63
63
  class Node
64
64
  attr_reader :version, :type, :node, :state, :log_dir, :ring_cur, :ring_prev, :joined_at,
65
- :tota_mem_usage, :system_mem_usage, :procs_mem_usage, :ets_mem_usage, :num_of_procs
65
+ :total_mem_usage, :system_mem_usage, :procs_mem_usage, :ets_mem_usage, :num_of_procs
66
66
 
67
67
  def initialize(h)
68
68
  @version = h[:version]
@@ -26,7 +26,7 @@ require "time"
26
26
  require_relative "leofs_manager_client/leofs_manager_models"
27
27
 
28
28
  module LeoFSManager
29
- VERSION = "0.2.4"
29
+ VERSION = "0.2.6"
30
30
 
31
31
  # Class for close TCP socket on GC.
32
32
  class Remover
@@ -71,6 +71,7 @@ module LeoFSManager
71
71
  set_current_server
72
72
  final = Remover.new(@data = [])
73
73
  ObjectSpace.define_finalizer(self, final)
74
+ @mutex = Mutex.new
74
75
  connect
75
76
  end
76
77
 
@@ -224,7 +225,7 @@ module LeoFSManager
224
225
  host = m[:host]
225
226
  port = Integer(m[:port])
226
227
 
227
- raise Error, "Invalid Port Number: #{port}" unless 0 <= port && port <= 65535
228
+ raise "Invalid Port Number: #{port}" unless 0 <= port && port <= 65535
228
229
  { :host => host, :port => port, :retry_count => 0 }
229
230
  else
230
231
  server
@@ -262,9 +263,12 @@ module LeoFSManager
262
263
  # Return::
263
264
  # Hash
264
265
  def sender(command)
266
+ response = nil
265
267
  begin
266
- @socket.puts command
267
- response = JSON.parse(@socket.gets, symbolize_names: true)
268
+ @mutex.synchronize do
269
+ @socket.puts command
270
+ response = JSON.parse(@socket.gets, symbolize_names: true)
271
+ end
268
272
  rescue => ex
269
273
  raise "An Error occured: #{ex.class} (server: #{@current_server})\n#{ex.message}"
270
274
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leofs_manager_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-09-27 00:00:00.000000000 Z
13
+ date: 2012-10-11 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: Client for LeoFS Manager
16
16
  email: