Skip to content

Commit

Permalink
server: handle messages in dedicated context of celluloid internal pool
Browse files Browse the repository at this point in the history
  • Loading branch information
niamster committed Feb 22, 2015
1 parent d4d5ecf commit 6d1ea2e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/dcell/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ def handle_message(message)
return
end

begin
message.dispatch
rescue => ex
Logger.crash("message dispatch failed", ex)
Celluloid::Future.new do
begin
message.dispatch
rescue => ex
Logger.crash("message dispatch failed", ex)
end
end
end

Expand Down Expand Up @@ -72,7 +74,7 @@ def initialize(cell)
# Wait for incoming 0MQ messages
def run
while true
async.handle_message @socket.read
handle_message @socket.read
end
end
end
Expand Down

0 comments on commit 6d1ea2e

Please sign in to comment.