REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.88 KB
Close
/proc/thread-self/root/opt/alt/ruby19/lib64/ruby/1.9.1/drb/gw.rb
Text
Base64
require 'drb/drb' require 'monitor' module DRb class GWIdConv < DRbIdConv def to_obj(ref) if Array === ref && ref[0] == :DRbObject return DRbObject.new_with(ref[1], ref[2]) end super(ref) end end class GW include MonitorMixin def initialize super() @hash = {} end def [](key) synchronize do @hash[key] end end def []=(key, v) synchronize do @hash[key] = v end end end class DRbObject def self._load(s) uri, ref = Marshal.load(s) if DRb.uri == uri return ref ? DRb.to_obj(ref) : DRb.front end self.new_with(DRb.uri, [:DRbObject, uri, ref]) end def _dump(lv) if DRb.uri == @uri if Array === @ref && @ref[0] == :DRbObject Marshal.dump([@ref[1], @ref[2]]) else Marshal.dump([@uri, @ref]) # ?? end else Marshal.dump([DRb.uri, [:DRbObject, @uri, @ref]]) end end end end =begin DRb.install_id_conv(DRb::GWIdConv.new) front = DRb::GW.new s1 = DRb::DRbServer.new('drbunix:/tmp/gw_b_a', front) s2 = DRb::DRbServer.new('drbunix:/tmp/gw_b_c', front) s1.thread.join s2.thread.join =end =begin # foo.rb require 'drb/drb' class Foo include DRbUndumped def initialize(name, peer=nil) @name = name @peer = peer end def ping(obj) puts "#{@name}: ping: #{obj.inspect}" @peer.ping(self) if @peer end end =end =begin # gw_a.rb require 'drb/unix' require 'foo' obj = Foo.new('a') DRb.start_service("drbunix:/tmp/gw_a", obj) robj = DRbObject.new_with_uri('drbunix:/tmp/gw_b_a') robj[:a] = obj DRb.thread.join =end =begin # gw_c.rb require 'drb/unix' require 'foo' foo = Foo.new('c', nil) DRb.start_service("drbunix:/tmp/gw_c", nil) robj = DRbObject.new_with_uri("drbunix:/tmp/gw_b_c") puts "c->b" a = robj[:a] sleep 2 a.ping(foo) DRb.thread.join =end
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 11
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
acl.rb
4.65 KB
lrw-r--r--
2011-05-19 00:07:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
drb.rb
53.09 KB
lrw-r--r--
2011-06-29 21:33:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
eq.rb
234 B
lrw-r--r--
2010-01-26 11:22:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
extserv.rb
1.19 KB
lrw-r--r--
2011-05-19 00:07:25
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
extservm.rb
1.71 KB
lrw-r--r--
2012-05-19 05:41:23
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
gw.rb
1.88 KB
lrw-r--r--
2009-10-02 10:45:39
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
invokemethod.rb
732 B
lrw-r--r--
2011-05-18 21:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
observer.rb
473 B
lrw-r--r--
2009-10-02 10:45:39
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ssl.rb
5.46 KB
lrw-r--r--
2014-01-30 12:04:22
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
timeridconv.rb
1.73 KB
lrw-r--r--
2011-05-18 21:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
unix.rb
2.55 KB
lrw-r--r--
2012-05-19 05:40:29
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).