public
Description: Ruby/Eventmachine driver for 10gen's object database Mongo
Homepage: http://github.com/10gen/mongo
Clone URL: git://github.com/tmm1/rmongo.git
rmongo / server.rb
100644 28 lines (23 sloc) 0.394 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require 'rubygems'
require 'eventmachine'
 
EM.run{
  
  module Proxy
    def initialize
      # p [:init]
    end
    def post_init
      # p [:connected]
    end
    def receive_data data
      p [:receive, data]
    end
    def send_data data
      p [:send, data]
      super
    end
    def unbind
      # p [:disconnected]
    end
  end
  
  EM.start_server '127.0.0.1', 27017, Proxy
  
}