rubarb 0.2.0
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/.gitignore +7 -0
- data/README +77 -0
- data/Rakefile +51 -0
- data/VERSION +1 -0
- data/examples/client.rb +32 -0
- data/examples/server.rb +34 -0
- data/lib/dkbrpc.rb +4 -0
- data/lib/rubarb.rb +2 -0
- data/lib/rubarb/connection.rb +170 -0
- data/lib/rubarb/connection_error.rb +11 -0
- data/lib/rubarb/connection_id.rb +11 -0
- data/lib/rubarb/default.rb +15 -0
- data/lib/rubarb/fast_message_protocol.rb +109 -0
- data/lib/rubarb/id.rb +13 -0
- data/lib/rubarb/incoming_connection.rb +25 -0
- data/lib/rubarb/insecure_method_call_error.rb +11 -0
- data/lib/rubarb/outgoing_connection.rb +27 -0
- data/lib/rubarb/remote_call.rb +12 -0
- data/lib/rubarb/responder.rb +18 -0
- data/lib/rubarb/server.rb +185 -0
- data/spec/rubarb/connection_failure_spec.rb +71 -0
- data/spec/rubarb/connection_spec.rb +187 -0
- data/spec/rubarb/id_spec.rb +26 -0
- data/spec/rubarb/incoming_connection_spec.rb +79 -0
- data/spec/rubarb/integration_spec.rb +174 -0
- data/spec/rubarb/outgoing_connection_spec.rb +103 -0
- data/spec/rubarb/remote_call_spec.rb +48 -0
- data/spec/rubarb/responder_spec.rb +35 -0
- data/spec/rubarb/server_failure_spec.rb +261 -0
- data/spec/rubarb/server_spec.rb +201 -0
- data/spec/spec_helper.rb +32 -0
- metadata +146 -0
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'spec'
|
3
|
+
require 'timeout'
|
4
|
+
|
5
|
+
require 'eventmachine'
|
6
|
+
|
7
|
+
def start_reactor
|
8
|
+
t = Thread.current
|
9
|
+
reactor = Thread.new do
|
10
|
+
EM.run do
|
11
|
+
t.wakeup
|
12
|
+
end
|
13
|
+
end
|
14
|
+
sleep(4)
|
15
|
+
reactor
|
16
|
+
end
|
17
|
+
|
18
|
+
def stop_reactor(reactor)
|
19
|
+
EM::schedule {EM.stop}
|
20
|
+
reactor.join
|
21
|
+
end
|
22
|
+
|
23
|
+
def wait_for
|
24
|
+
Timeout::timeout(5) do
|
25
|
+
while !yield
|
26
|
+
Thread.pass
|
27
|
+
end
|
28
|
+
end
|
29
|
+
rescue Timeout::Error => e
|
30
|
+
end
|
31
|
+
|
32
|
+
#$DEBUG = true
|
metadata
ADDED
@@ -0,0 +1,146 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rubarb
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 0.2.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- doug bradbury
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-11-12 00:00:00 -06:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: rspec
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 27
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 3
|
33
|
+
- 0
|
34
|
+
version: 1.3.0
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: eventmachine
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 57
|
46
|
+
segments:
|
47
|
+
- 0
|
48
|
+
- 12
|
49
|
+
- 11
|
50
|
+
version: 0.12.11
|
51
|
+
type: :runtime
|
52
|
+
version_requirements: *id002
|
53
|
+
description: |-
|
54
|
+
This library uses two socket connections between a client and a server. One is used for request / replies from the
|
55
|
+
client to the server. The other is used for remote calls made from the server to the client.
|
56
|
+
|
57
|
+
Each end publishes a single object on which
|
58
|
+
methods can be called by the remote end. All calls to the remote objects are asyncronous. Do not make any blocking
|
59
|
+
calls in the published object. Responses are return by calling the "reply method on the responder object.
|
60
|
+
email: doug@8thlight.com
|
61
|
+
executables: []
|
62
|
+
|
63
|
+
extensions: []
|
64
|
+
|
65
|
+
extra_rdoc_files:
|
66
|
+
- README
|
67
|
+
files:
|
68
|
+
- .gitignore
|
69
|
+
- README
|
70
|
+
- Rakefile
|
71
|
+
- VERSION
|
72
|
+
- examples/client.rb
|
73
|
+
- examples/server.rb
|
74
|
+
- lib/dkbrpc.rb
|
75
|
+
- lib/rubarb.rb
|
76
|
+
- lib/rubarb/connection.rb
|
77
|
+
- lib/rubarb/connection_error.rb
|
78
|
+
- lib/rubarb/connection_id.rb
|
79
|
+
- lib/rubarb/default.rb
|
80
|
+
- lib/rubarb/fast_message_protocol.rb
|
81
|
+
- lib/rubarb/id.rb
|
82
|
+
- lib/rubarb/incoming_connection.rb
|
83
|
+
- lib/rubarb/insecure_method_call_error.rb
|
84
|
+
- lib/rubarb/outgoing_connection.rb
|
85
|
+
- lib/rubarb/remote_call.rb
|
86
|
+
- lib/rubarb/responder.rb
|
87
|
+
- lib/rubarb/server.rb
|
88
|
+
- spec/rubarb/connection_failure_spec.rb
|
89
|
+
- spec/rubarb/connection_spec.rb
|
90
|
+
- spec/rubarb/id_spec.rb
|
91
|
+
- spec/rubarb/incoming_connection_spec.rb
|
92
|
+
- spec/rubarb/integration_spec.rb
|
93
|
+
- spec/rubarb/outgoing_connection_spec.rb
|
94
|
+
- spec/rubarb/remote_call_spec.rb
|
95
|
+
- spec/rubarb/responder_spec.rb
|
96
|
+
- spec/rubarb/server_failure_spec.rb
|
97
|
+
- spec/rubarb/server_spec.rb
|
98
|
+
- spec/spec_helper.rb
|
99
|
+
has_rdoc: true
|
100
|
+
homepage: http://github.com/dougbradbury/rubarb
|
101
|
+
licenses: []
|
102
|
+
|
103
|
+
post_install_message:
|
104
|
+
rdoc_options:
|
105
|
+
- --charset=UTF-8
|
106
|
+
require_paths:
|
107
|
+
- lib
|
108
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
hash: 3
|
114
|
+
segments:
|
115
|
+
- 0
|
116
|
+
version: "0"
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
hash: 3
|
123
|
+
segments:
|
124
|
+
- 0
|
125
|
+
version: "0"
|
126
|
+
requirements: []
|
127
|
+
|
128
|
+
rubyforge_project:
|
129
|
+
rubygems_version: 1.3.7
|
130
|
+
signing_key:
|
131
|
+
specification_version: 3
|
132
|
+
summary: A Bidirectional Event Machine Based Remote Procedure Call Library for Ruby
|
133
|
+
test_files:
|
134
|
+
- spec/rubarb/connection_failure_spec.rb
|
135
|
+
- spec/rubarb/connection_spec.rb
|
136
|
+
- spec/rubarb/id_spec.rb
|
137
|
+
- spec/rubarb/incoming_connection_spec.rb
|
138
|
+
- spec/rubarb/integration_spec.rb
|
139
|
+
- spec/rubarb/outgoing_connection_spec.rb
|
140
|
+
- spec/rubarb/remote_call_spec.rb
|
141
|
+
- spec/rubarb/responder_spec.rb
|
142
|
+
- spec/rubarb/server_failure_spec.rb
|
143
|
+
- spec/rubarb/server_spec.rb
|
144
|
+
- spec/spec_helper.rb
|
145
|
+
- examples/client.rb
|
146
|
+
- examples/server.rb
|