msgpack-rpc-over-http 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  This library provides [MessagePack-RPC](https://github.com/msgpack/msgpack-rpc) via HTTP as XML-RPC.
4
4
  The original MessagePack-RPC Server in Ruby is not good in some cases.
5
- It doesn't scale. It's incompatible with Thread. There is no decent termination...
5
+ It doesn't scale. It's incompatible with Thread. There is no decent termination processing...
6
6
 
7
7
  We alreadly have various high perfomance HTTP servers.
8
8
  We can use these in MessagePack-RPC over HTTP.
@@ -10,7 +10,7 @@ We can use these in MessagePack-RPC over HTTP.
10
10
  **CAUTION**
11
11
 
12
12
  There is no compatibility with other implementation of normal MessagePack-RPC (not over HTTP).
13
- So you can not connect a normal RPC client to a RPC server over HTTP.
13
+ So a normal RPC client can not connect a HTTP server.
14
14
 
15
15
  ## Usage
16
16
 
data/Rakefile CHANGED
@@ -1,2 +1,8 @@
1
1
  #!/usr/bin/env rake
2
+ require "bundler/setup"
3
+ Bundler.require(:default, :development)
2
4
  require "bundler/gem_tasks"
5
+
6
+ task :default do
7
+ sh "/usr/bin/env ruby test/run-test.rb"
8
+ end
@@ -9,7 +9,7 @@ module MessagePack
9
9
  class Client
10
10
  extend Forwardable
11
11
 
12
- HEADER = {"Content-Type" => 'text/plain'}
12
+ HEADER = {"Content-Type" => 'application/x-msgpack'}
13
13
 
14
14
  def initialize(url, options={})
15
15
  @url = url
@@ -19,7 +19,7 @@ module MessagePack
19
19
  end
20
20
 
21
21
  def_delegators(:@client,
22
- :connect_timeout, :send_timeout, :receive_timeout)
22
+ :connect_timeout, :send_timeout, :receive_timeout, :debug_dev=)
23
23
 
24
24
  # call-seq:
25
25
  # call(symbol, *args) -> result of remote method
@@ -29,7 +29,7 @@ module MessagePack
29
29
  ]
30
30
  end
31
31
 
32
- if req.media_type != "text/plain"
32
+ if req.media_type != "application/x-msgpack"
33
33
  return [
34
34
  400, # Bad Request
35
35
  {'Content-Type' => 'text/plain'},
@@ -1,5 +1,5 @@
1
1
  module MessagePack
2
2
  module RPCOverHTTP
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
data/test/test_client.rb CHANGED
@@ -43,6 +43,11 @@ module MessagePack::RPCOverHTTP
43
43
  future = @client.call(:error)
44
44
  future.value
45
45
  end
46
+
47
+ # multi-call
48
+ (1..20).map{|i| [@client.call_async(:test, i), i] }.each do |f, i|
49
+ assert_equal [i], f.value
50
+ end
46
51
  end
47
52
 
48
53
  def test_callback
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: msgpack-rpc-over-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-03 00:00:00.000000000 Z
12
+ date: 2012-11-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
@@ -113,12 +113,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
113
  - - ! '>='
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
+ segments:
117
+ - 0
118
+ hash: 783699386878995267
116
119
  required_rubygems_version: !ruby/object:Gem::Requirement
117
120
  none: false
118
121
  requirements:
119
122
  - - ! '>='
120
123
  - !ruby/object:Gem::Version
121
124
  version: '0'
125
+ segments:
126
+ - 0
127
+ hash: 783699386878995267
122
128
  requirements: []
123
129
  rubyforge_project:
124
130
  rubygems_version: 1.8.24