REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.73 KB
Close
//proc/thread-self/root/opt/alt/ruby19/lib64/ruby/1.9.1/drb/timeridconv.rb
Text
Base64
require 'drb/drb' require 'monitor' module DRb class TimerIdConv < DRbIdConv class TimerHolder2 include MonitorMixin class InvalidIndexError < RuntimeError; end def initialize(timeout=600) super() @sentinel = Object.new @gc = {} @curr = {} @renew = {} @timeout = timeout @keeper = keeper end def add(obj) synchronize do key = obj.__id__ @curr[key] = obj return key end end def fetch(key, dv=@sentinel) synchronize do obj = peek(key) if obj == @sentinel return dv unless dv == @sentinel raise InvalidIndexError end @renew[key] = obj # KeepIt return obj end end def include?(key) synchronize do obj = peek(key) return false if obj == @sentinel true end end def peek(key) synchronize do return @curr.fetch(key, @renew.fetch(key, @gc.fetch(key, @sentinel))) end end private def alternate synchronize do @gc = @curr # GCed @curr = @renew @renew = {} end end def keeper Thread.new do loop do alternate sleep(@timeout) end end end end def initialize(timeout=600) @holder = TimerHolder2.new(timeout) end def to_obj(ref) return super if ref.nil? @holder.fetch(ref) rescue TimerHolder2::InvalidIndexError raise "invalid reference" end def to_id(obj) return @holder.add(obj) end end end # DRb.install_id_conv(TimerIdConv.new)
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).