arya-pandemic 0.3.8 → 0.3.9
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.
- data/Rakefile +1 -1
- data/lib/pandemic/client_side/cluster_connection.rb +7 -1
- data/lib/pandemic/client_side/connection.rb +6 -1
- data/pandemic.gemspec +1 -1
- metadata +1 -1
data/Rakefile
CHANGED
|
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
|
2
2
|
require 'rake'
|
|
3
3
|
require 'echoe'
|
|
4
4
|
|
|
5
|
-
Echoe.new('pandemic', '0.3.
|
|
5
|
+
Echoe.new('pandemic', '0.3.9') do |p|
|
|
6
6
|
p.description = "Distribute MapReduce to any of the workers and it will spread, like a pandemic."
|
|
7
7
|
p.url = "https://github.com/arya/pandemic/"
|
|
8
8
|
p.author = "Arya Asemanfar"
|
|
@@ -44,6 +44,7 @@ module Pandemic
|
|
|
44
44
|
key, options = nil, key if key.is_a?(Hash)
|
|
45
45
|
with_connection(key) do |socket|
|
|
46
46
|
begin
|
|
47
|
+
raise LostConnectionToNode if socket.nil?
|
|
47
48
|
flags = []
|
|
48
49
|
if options[:async]
|
|
49
50
|
flags << "a"
|
|
@@ -64,7 +65,7 @@ module Pandemic
|
|
|
64
65
|
raise LostConnectionToNode
|
|
65
66
|
end
|
|
66
67
|
end
|
|
67
|
-
rescue Errno::ECONNRESET
|
|
68
|
+
rescue Errno::ECONNRESET, Errno::EPIPE
|
|
68
69
|
raise LostConnectionToNode
|
|
69
70
|
end
|
|
70
71
|
end
|
|
@@ -76,6 +77,9 @@ module Pandemic
|
|
|
76
77
|
begin
|
|
77
78
|
connection = checkout_connection(key)
|
|
78
79
|
block.call(connection.socket)
|
|
80
|
+
rescue LostConnectionToNode
|
|
81
|
+
connection.died!
|
|
82
|
+
raise
|
|
79
83
|
ensure
|
|
80
84
|
checkin_connection(connection) if connection
|
|
81
85
|
end
|
|
@@ -90,6 +94,8 @@ module Pandemic
|
|
|
90
94
|
if select_from.size > 0
|
|
91
95
|
connection = select_from.pop
|
|
92
96
|
connection.ensure_alive!
|
|
97
|
+
break unless connection.alive?
|
|
98
|
+
|
|
93
99
|
if key.nil?
|
|
94
100
|
@grouped_available[key].delete(connection)
|
|
95
101
|
else
|
data/pandemic.gemspec
CHANGED