Sha256: f5522737715899e3e9cf92dba65c6afd438ec4a744d5d1348476b363dc4663c1

Contents?: true

Size: 723 Bytes

Versions: 118

Compression:

Stored size: 723 Bytes

Contents

#!/usr/local/bin/ruby -w
                                                                                
# This is a really simple session storage daemon, basically just a hash, 
# which is enabled for DRb access.
                                                                                
require 'drb'

session_hash = Hash.new
session_hash.instance_eval { @mutex = Mutex.new }

class <<session_hash
  def []=(key, value)
    @mutex.synchronize do
      super(key, value)
    end
  end
  
  def [](key)
    @mutex.synchronize do
      super(key)
    end
  end
  
  def delete(key)
    @mutex.synchronize do
      super(key)
    end
  end
end

DRb.start_service('druby://127.0.0.1:9192', session_hash)
DRb.thread.join

Version data entries

118 entries across 118 versions & 9 rubygems

Version Path
devise_sociable-0.1.0 vendor/bundle/gems/actionpack-1.4.0/lib/action_controller/session/drb_server.rb
radiant-0.7.2 vendor/rails/actionpack/lib/action_controller/session/drb_server.rb
vibes-bj-1.2.2 spec/rails_root/vendor/rails/actionpack/lib/action_controller/session/drb_server.rb
vibes-bj-1.2.1 spec/rails_root/vendor/rails/actionpack/lib/action_controller/session/drb_server.rb
actionpack-1.11.1 lib/action_controller/session/drb_server.rb
actionpack-1.10.1 lib/action_controller/session/drb_server.rb
actionpack-1.11.2 lib/action_controller/session/drb_server.rb
actionpack-1.12.1 lib/action_controller/session/drb_server.rb
actionpack-1.12.0 lib/action_controller/session/drb_server.rb
actionpack-1.10.2 lib/action_controller/session/drb_server.rb
actionpack-1.11.0 lib/action_controller/session/drb_server.rb
actionpack-1.12.4 lib/action_controller/session/drb_server.rb
actionpack-1.12.2 lib/action_controller/session/drb_server.rb
actionpack-1.13.0 lib/action_controller/session/drb_server.rb
actionpack-1.12.3 lib/action_controller/session/drb_server.rb
actionpack-1.12.5 lib/action_controller/session/drb_server.rb
actionpack-1.13.4 lib/action_controller/session/drb_server.rb
actionpack-1.13.5 lib/action_controller/session/drb_server.rb
actionpack-1.13.3 lib/action_controller/session/drb_server.rb
actionpack-1.13.1 lib/action_controller/session/drb_server.rb