tarantool 0.4.3.7 → 0.4.3.8
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/lib/tarantool/em_db.rb +3 -3
- data/lib/tarantool/request.rb +3 -0
- data/lib/tarantool/response.rb +7 -5
- data/lib/tarantool/version.rb +1 -1
- metadata +1 -1
data/lib/tarantool/em_db.rb
CHANGED
@@ -66,7 +66,7 @@ module Tarantool
|
|
66
66
|
if Exception === (result = _parse_iproto(result))
|
67
67
|
@feed.call result
|
68
68
|
else
|
69
|
-
@feed.call @response.
|
69
|
+
@feed.call @response.parse_response_for_cb(result)
|
70
70
|
end
|
71
71
|
end
|
72
72
|
end
|
@@ -94,7 +94,7 @@ module Tarantool
|
|
94
94
|
when Exception
|
95
95
|
@feed.call result
|
96
96
|
else
|
97
|
-
@feed.call @response.
|
97
|
+
@feed.call @response.parse_response_for_cb(result)
|
98
98
|
end
|
99
99
|
end
|
100
100
|
end
|
@@ -131,7 +131,7 @@ module Tarantool
|
|
131
131
|
@feed.call result
|
132
132
|
else
|
133
133
|
@replicas_origin.replace @replicas
|
134
|
-
@feed.call @response.
|
134
|
+
@feed.call @response.parse_response_for_cb(result)
|
135
135
|
end
|
136
136
|
end
|
137
137
|
end
|
data/lib/tarantool/request.rb
CHANGED
data/lib/tarantool/response.rb
CHANGED
@@ -28,11 +28,7 @@ module Tarantool
|
|
28
28
|
cb.call(data)
|
29
29
|
else
|
30
30
|
if (ret = return_code(data)) == 0
|
31
|
-
call_callback
|
32
|
-
parse_response(data)
|
33
|
-
rescue StandardError => e
|
34
|
-
e
|
35
|
-
end
|
31
|
+
call_callback parse_response_for_cb(data)
|
36
32
|
else
|
37
33
|
data.gsub!("\x00", "")
|
38
34
|
cb.call CODE_TO_EXCEPTION[ret].new(ret, data)
|
@@ -48,6 +44,12 @@ module Tarantool
|
|
48
44
|
cb.call(Exception === result || get_tuples != :first ? result : result.first)
|
49
45
|
end
|
50
46
|
|
47
|
+
def parse_response_for_cb(data)
|
48
|
+
parse_response data
|
49
|
+
rescue StandardError => e
|
50
|
+
e
|
51
|
+
end
|
52
|
+
|
51
53
|
def parse_response(data)
|
52
54
|
return data if Exception === data
|
53
55
|
unless get_tuples
|
data/lib/tarantool/version.rb
CHANGED