msgpack-rpc-stack 0.6.3 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/msgpack/rpc/client.rb +10 -3
- data/lib/msgpack/rpc/version.rb +1 -1
- data/msgpack-rpc-stack.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd76cc71b043173ef94c8f7d21041a9ac2490c03f2cfc936ad3dddb3e0cb40b8
|
4
|
+
data.tar.gz: b0d2e72657bf2e3bca72870f9f1ca7388178cf33d708080a3f0ec32531aa2a47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8ae673b9d04a9ea9ff4baaad08b4d4c1af92df50f93f8f72fcc4941171c1c05eea8a8ff7438a43b92c804f79a3f1a64824ff8225e4a4e22fafc03896a864dc4
|
7
|
+
data.tar.gz: 74142d315c72fe443f8fcf5aaf952a453ffae01a19208d332a73ad93a662bb7690429f07aa8d73a543962cdf68b532cf3e31b1b13d969f171cfbc2948aa5cdaf
|
data/lib/msgpack/rpc/client.rb
CHANGED
@@ -57,7 +57,7 @@ module MessagePack
|
|
57
57
|
private :unpacker
|
58
58
|
|
59
59
|
def error_occured(e)
|
60
|
-
e = ProtocolError.new(
|
60
|
+
e = ProtocolError.new(e) if e.kind_of?(String)
|
61
61
|
|
62
62
|
if self.respond_to?(:on_error, true)
|
63
63
|
__send__(:on_error, e)
|
@@ -74,12 +74,18 @@ module MessagePack
|
|
74
74
|
|
75
75
|
session_map[id] = blk
|
76
76
|
send_data([0, id, meth, args].to_msgpack)
|
77
|
+
|
78
|
+
return id
|
77
79
|
end
|
78
80
|
|
79
81
|
def notify(meth, *args)
|
80
82
|
send_data([2, meth, args].to_msgpack)
|
81
83
|
end
|
82
84
|
|
85
|
+
def cancel(id)
|
86
|
+
session_map.delete(id)
|
87
|
+
end
|
88
|
+
|
83
89
|
def eval_response(resp)
|
84
90
|
if not resp.kind_of?(Array)
|
85
91
|
error_occured("responce is not array")
|
@@ -101,7 +107,8 @@ module MessagePack
|
|
101
107
|
session_map.delete(id).(nil, error)
|
102
108
|
|
103
109
|
else
|
104
|
-
|
110
|
+
session_map.delete(id)
|
111
|
+
error_occured("invalid responce data")
|
105
112
|
end
|
106
113
|
|
107
114
|
when 2 # as notification
|
@@ -122,7 +129,7 @@ module MessagePack
|
|
122
129
|
private :eval_response
|
123
130
|
|
124
131
|
def receive_dgram(data)
|
125
|
-
|
132
|
+
eval_response(MessagePack.unpack(data, self.class.msgpack_options))
|
126
133
|
end
|
127
134
|
|
128
135
|
def receive_stream(data)
|
data/lib/msgpack/rpc/version.rb
CHANGED
data/msgpack-rpc-stack.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
|
36
36
|
spec.required_ruby_version = ">= 2.4.0"
|
37
37
|
|
38
|
-
spec.add_development_dependency "bundler", "~>
|
38
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
39
39
|
spec.add_development_dependency "rake", "~> 10.0"
|
40
40
|
spec.add_dependency "msgpack", "~> 1.2.6"
|
41
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: msgpack-rpc-stack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroshi Kuwagata
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|