File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -235,6 +235,13 @@ def glibize
235235 end
236236 end
237237
238+ def eventmachinize
239+ require File . join ( File . dirname ( File . expand_path ( __FILE__ ) ) , "loop-em" )
240+
241+ conn = ::EventMachine . watch ( @message_queue . socket , Loop ::EventMachine ::Reader , self )
242+ conn . notify_readable = true
243+ end
244+
238245 # FIXME: describe the following names, flags and constants.
239246 # See DBus spec for definition
240247 NAME_FLAG_ALLOW_REPLACEMENT = 0x1
Original file line number Diff line number Diff line change 1+ require 'eventmachine'
2+
3+ module DBus
4+ module Loop
5+ module EventMachine
6+ class Reader < ::EventMachine ::Connection
7+ def initialize ( parent )
8+ @parent = parent
9+ end
10+
11+ def notify_readable
12+ @parent . dispatch_message_queue
13+ rescue EOFError
14+ detach
15+ end
16+ end
17+ end
18+ end
19+ end
You can’t perform that action at this time.
0 commit comments