nobject 1.1.9 → 1.1.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01dcdc821f2b06b03b96282723b4d182e94568b2e0638e449f617d07997dbbf2
4
- data.tar.gz: cd05daf2e5f7bc5b70989ed458c7e0dd94b2bb2517cfe08a735a169337a756b0
3
+ metadata.gz: 258d8745928db2aa362e8f2153c7472bbd4edeb8332c06fd6585dd98b1e4a514
4
+ data.tar.gz: 951050aacf7ea2bca127084e50eea66fe93bb06b1404807f7d4c58b4bc540171
5
5
  SHA512:
6
- metadata.gz: fdab616b26d403aed00b0c76dbb87ef9b3e7b1d89418de6ccc8960f7bfb31ff976f1a4720712785b283f65aee5c4a5ec1b49a98af294ab762531c5059ef10768
7
- data.tar.gz: 924cd1453bf40a411f2c57c126a45012ad9ed03db1f6460379e5104cb8f2f1376be2e7857057dd2a806875cedeafb27b47e922a3881bd608b4072904f73a68f1
6
+ metadata.gz: 60a285e9dad1e9c3d30b416c001ced58566b122c84130f0faaaa06fc4edb14249cfaddf9c168a9bb7ddcaebe2052f59e66f2565dacde7d81e3d372b60723e469
7
+ data.tar.gz: a1313813596afcaf3feb89fd46fca56d1fb1d67171322987353568cfea825bcb155642bcf3e1b031510e1be3c7a896fbeadeb8ab0b1158b6a76db076bf34d2f4
data/lib/nobject/local.rb CHANGED
@@ -17,7 +17,7 @@ module Nobject
17
17
  @socket = TCPSocket.new(host, port)
18
18
  obj_bytes = Marshal.dump(obj)
19
19
 
20
- File.open('/tmp/nobject.log', 'a') {|f| f.puts "L:#{@msg_counter += 1} #{obj_bytes.length}"; f.flush }
20
+ File.open('/tmp/nobject.log', 'a') {|f| f.puts "L:##{@msg_counter += 1} sz#{obj_bytes.length}"; f.flush }
21
21
  @socket.send([obj_bytes.length].pack('Q>'), 0)
22
22
  @socket.send(obj_bytes, 0)
23
23
  end
@@ -28,7 +28,7 @@ module Nobject
28
28
 
29
29
  begin
30
30
  @socket.send([msg_bytes.length].pack('Q>'), 0)
31
- File.open('/tmp/nobject.log', 'a') {|f| f.puts " LMS:#{@msg_counter += 1} #{msg_bytes.length}"; f.flush }
31
+ File.open('/tmp/nobject.log', 'a') {|f| f.puts " LMS:##{@msg_counter += 1} sz#{msg_bytes.length}"; f.flush }
32
32
  @socket.send(msg_bytes, 0)
33
33
  rescue Exception
34
34
  raise Local::MethodRequestFailure.new("did not receive response from call to `#{method}' over the network")
@@ -36,10 +36,17 @@ module Nobject
36
36
 
37
37
  return_data = begin
38
38
  msg_size = @socket.recv(8).unpack('Q>').first
39
- File.open('/tmp/nobject.log', 'a') {|f| f.puts " LMGotit :#{@msg_counter += 1} #{msg_size}"; f.flush }
39
+ File.open('/tmp/nobject.log', 'a') {|f| f.puts " LMGotit :##{@msg_counter += 1} sz#{msg_size}"; f.flush }
40
40
  Marshal.load(@socket.recv(msg_size))
41
- rescue Exception
42
- raise Local::MethodResponseFailure.new("did not receive response from call to `#{method}' over the network")
41
+ rescue Exception => e
42
+ error_msg = <<~MSG
43
+ did not receive response from call to `#{method}' over the network
44
+ would have been msg_id #{msg_counter} OR #{msg_counter + 1}
45
+ caused by #{e.class.name}
46
+ exception backtrace:
47
+ #{e.backtrace.join("\n ")}
48
+ MSG
49
+ raise Local::MethodResponseFailure.new(error_msg)
43
50
  end
44
51
 
45
52
  case return_data.first
@@ -7,7 +7,7 @@ module Nobject
7
7
  @msg_counter = 0
8
8
  @socket = socket
9
9
  obj_size = @socket.recv(8).unpack('Q>').first
10
- File.open('/tmp/nobject.log', 'a') {|f| f.puts "R:#{@msg_counter += 1} #{obj_size}"; f.flush }
10
+ File.open('/tmp/nobject.log', 'a') {|f| f.puts "R:##{@msg_counter += 1} sz#{obj_size}"; f.flush }
11
11
  @obj = Marshal.load(@socket.recv(obj_size))
12
12
  end
13
13
 
@@ -15,7 +15,7 @@ module Nobject
15
15
  Thread.new do
16
16
  loop do
17
17
  msg_size = @socket.recv(8).unpack('Q>').first
18
- File.open('/tmp/nobject.log', 'a') {|f| f.puts " RMR:#{@msg_counter += 1} #{msg_size}"; f.flush }
18
+ File.open('/tmp/nobject.log', 'a') {|f| f.puts " RMR:##{@msg_counter += 1} sz#{msg_size}"; f.flush }
19
19
  msg = Marshal.load(@socket.recv(msg_size))
20
20
 
21
21
  result = @obj.send(msg[:method], *msg[:args])
@@ -31,7 +31,7 @@ module Nobject
31
31
  data_bytes = Marshal.dump(data)
32
32
 
33
33
  @socket.send([data_bytes.length].pack('Q>'), 0)
34
- File.open('/tmp/nobject.log', 'a') {|f| f.puts " RMResult:#{@msg_counter += 1} #{data_bytes.length}"; f.flush }
34
+ File.open('/tmp/nobject.log', 'a') {|f| f.puts " RMResult:##{@msg_counter += 1} sz#{data_bytes.length}"; f.flush }
35
35
  @socket.send(data_bytes, 0)
36
36
  end
37
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nobject
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.9
4
+ version: 1.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Lunt