emdrb 0.3.0 → 0.3.1
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/History.txt +3 -0
- data/README.txt +8 -1
- data/lib/emdrb/emdrb.rb +19 -22
- data/lib/emdrb/version.rb +2 -2
- metadata +2 -2
data/History.txt
CHANGED
data/README.txt
CHANGED
@@ -33,6 +33,8 @@ It is, however, not yet a complete replacement for the standard DRb:
|
|
33
33
|
* No SSL support. To support this fully, EventMachine needs to have
|
34
34
|
more comprehensive SSL/TLS support.
|
35
35
|
* RSpec tests are very basic, and need a lot more comprehensive work.
|
36
|
+
They also don't work for some reason when run under Rake, but work
|
37
|
+
just fine when run manually.
|
36
38
|
* Many standard configuration options for DRb still unsupported
|
37
39
|
|
38
40
|
These and many other problems are scheduled to be addressed in the
|
@@ -100,11 +102,16 @@ if you would like to run the rspec tests that are included with
|
|
100
102
|
EMDRb. Daemons is not required to use EMDRb otherwise, and as such it
|
101
103
|
is not listed as a hard dependency in the gem install.
|
102
104
|
|
105
|
+
If you want to install it manually, you can always download it at the
|
106
|
+
EMDRb project page at:
|
107
|
+
|
108
|
+
http://rubyforge.org/projects/emdrb
|
109
|
+
|
103
110
|
== LICENSE:
|
104
111
|
|
105
112
|
Copyright © 2008, 2009 Rafael R. Sevilla. You can redistribute it
|
106
113
|
and/or modify it under the same terms as Ruby. Please see the file
|
107
114
|
COPYING for more details.
|
108
115
|
|
109
|
-
$Id: README.txt
|
116
|
+
$Id: README.txt 88 2009-02-04 04:10:52Z dido $
|
110
117
|
|
data/lib/emdrb/emdrb.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# Homepage:: http://emdrb.rubyforge.org/
|
5
5
|
# License:: GNU General Public License / Ruby License
|
6
6
|
#
|
7
|
-
# $Id: emdrb.rb
|
7
|
+
# $Id: emdrb.rb 87 2009-02-04 04:08:06Z dido $
|
8
8
|
#
|
9
9
|
#----------------------------------------------------------------------------
|
10
10
|
#
|
@@ -174,7 +174,6 @@ module DRb
|
|
174
174
|
# The peer address for this connection.
|
175
175
|
attr_accessor :peer_addr
|
176
176
|
|
177
|
-
|
178
177
|
##
|
179
178
|
# The post initialization process sets up the default load
|
180
179
|
# and argument length limits, the idconv object, the initial
|
@@ -209,10 +208,9 @@ module DRb
|
|
209
208
|
# also further execute the method call in its own independent thread
|
210
209
|
# and safe level invocations are also taken care of herein.
|
211
210
|
def perform_without_block
|
212
|
-
df = EventMachine::DefaultDeferrable.new
|
213
211
|
info = Thread.current['DRb']
|
214
212
|
req = @request
|
215
|
-
|
213
|
+
op = lambda do
|
216
214
|
Thread.current['DRb'] = info
|
217
215
|
if $SAFE < @safe_level
|
218
216
|
$SAFE = @safe_level
|
@@ -221,22 +219,16 @@ module DRb
|
|
221
219
|
if Proc == req[:ro] && req[:msg] == :__drb_yield
|
222
220
|
ary = (req[:argv].size == 1) ? req[:argv] :
|
223
221
|
[req[:argv]]
|
224
|
-
|
225
|
-
df.set_deferred_status(:succeeded, ary.collect(&@front)[0])
|
226
|
-
end
|
222
|
+
[true, ary.collect(&@front)[0]]
|
227
223
|
else
|
228
224
|
r = req[:ro].__send__(req[:msg], *req[:argv])
|
229
|
-
|
230
|
-
df.set_deferred_status(:succeeded, r)
|
231
|
-
end
|
225
|
+
[true, r]
|
232
226
|
end
|
233
227
|
rescue
|
234
|
-
|
235
|
-
df.set_deferred_status(:failed, $!)
|
236
|
-
end
|
228
|
+
[false, $!]
|
237
229
|
end
|
238
230
|
end
|
239
|
-
return(
|
231
|
+
return(op)
|
240
232
|
end
|
241
233
|
|
242
234
|
##
|
@@ -260,10 +252,9 @@ module DRb
|
|
260
252
|
# I suppose there must be a way to do it without using threads (possibly
|
261
253
|
# by using call/cc perhaps?), but I suppose this should be okay.
|
262
254
|
def perform_with_block
|
263
|
-
df = EventMachine::DefaultDeferrable.new
|
264
255
|
info = Thread.current['DRb']
|
265
256
|
req = @request
|
266
|
-
|
257
|
+
op = lambda do
|
267
258
|
Thread.current['DRb'] = info
|
268
259
|
if $SAFE < @safe_level
|
269
260
|
$SAFE = @safe_level
|
@@ -289,14 +280,12 @@ module DRb
|
|
289
280
|
end
|
290
281
|
block_value
|
291
282
|
}
|
292
|
-
|
283
|
+
[true, r]
|
293
284
|
rescue Exception => e
|
294
|
-
|
295
|
-
df.set_deferred_status(:failed, e)
|
296
|
-
end
|
285
|
+
[false, e]
|
297
286
|
end
|
298
287
|
end
|
299
|
-
return(
|
288
|
+
return(op)
|
300
289
|
end
|
301
290
|
|
302
291
|
##
|
@@ -315,7 +304,15 @@ module DRb
|
|
315
304
|
@request[:argv],
|
316
305
|
@request[:block]))
|
317
306
|
end
|
318
|
-
|
307
|
+
df = EventMachine::DefaultDeferrable.new
|
308
|
+
op = (@request[:block]) ? perform_with_block : perform_without_block
|
309
|
+
callback = lambda do |res|
|
310
|
+
succ, val = res
|
311
|
+
df.set_deferred_status((succ) ? :succeeded : :failed, val)
|
312
|
+
end
|
313
|
+
|
314
|
+
EventMachine::defer(op, callback)
|
315
|
+
return(df)
|
319
316
|
end
|
320
317
|
|
321
318
|
def to_obj(ref)
|
data/lib/emdrb/version.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# Homepage:: http://emdrb.rubyforge.org/
|
5
5
|
# License:: GNU Lesser General Public License / Ruby License
|
6
6
|
#
|
7
|
-
# $Id: version.rb
|
7
|
+
# $Id: version.rb 83 2009-02-04 03:39:51Z dido $
|
8
8
|
#
|
9
9
|
#----------------------------------------------------------------------------
|
10
10
|
#
|
@@ -26,7 +26,7 @@ module EMDRb
|
|
26
26
|
|
27
27
|
MAJOR = 0
|
28
28
|
MINOR = 3
|
29
|
-
TINY =
|
29
|
+
TINY = 1
|
30
30
|
|
31
31
|
# The version of EMDRb in use.
|
32
32
|
STRING = [ MAJOR, MINOR, TINY ].join(".")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emdrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dido@imperium.ph
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-02-04 00:00:00 +08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|