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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dcca66fedc4f14b5def751157fef92927c9eb1cda24e79f72659ca79afc5898d
4
- data.tar.gz: 8ac3ded467f2235be2e4c982ff5f11badfb0748ac952b9d9244d4e87fe70ea9a
3
+ metadata.gz: dd76cc71b043173ef94c8f7d21041a9ac2490c03f2cfc936ad3dddb3e0cb40b8
4
+ data.tar.gz: b0d2e72657bf2e3bca72870f9f1ca7388178cf33d708080a3f0ec32531aa2a47
5
5
  SHA512:
6
- metadata.gz: 73af4f48c0178177784087a0afab26d8358c7d37b6752fa8005ef639fc39c4081a7e8956eaef9457b33ed888c0c8cb2e7aa72896123c5e123ab9ead118b369bc
7
- data.tar.gz: c9180d58dced21f8b88d9b7b852049f419738d0757be35b8bd4c6c26b56ee70a86cf83e16871fe5817b93c121d82ee55fcdbf7a2e367cc3f348b0a78973a44d5
6
+ metadata.gz: f8ae673b9d04a9ea9ff4baaad08b4d4c1af92df50f93f8f72fcc4941171c1c05eea8a8ff7438a43b92c804f79a3f1a64824ff8225e4a4e22fafc03896a864dc4
7
+ data.tar.gz: 74142d315c72fe443f8fcf5aaf952a453ffae01a19208d332a73ad93a662bb7690429f07aa8d73a543962cdf68b532cf3e31b1b13d969f171cfbc2948aa5cdaf
@@ -57,7 +57,7 @@ module MessagePack
57
57
  private :unpacker
58
58
 
59
59
  def error_occured(e)
60
- e = ProtocolError.new(m) if e.kind_of?(String)
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
- error_occured("unknwon responce id is received.")
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
- eval_eval_response(MessagePack.unpack(data, self.class.msgpack_options))
132
+ eval_response(MessagePack.unpack(data, self.class.msgpack_options))
126
133
  end
127
134
 
128
135
  def receive_stream(data)
@@ -1,5 +1,5 @@
1
1
  module MessagePack
2
2
  module Rpc
3
- VERSION = "0.6.3"
3
+ VERSION = "0.7.0"
4
4
  end
5
5
  end
@@ -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", "~> 1.17"
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.6.3
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-03-21 00:00:00.000000000 Z
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: '1.17'
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: '1.17'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement