Browse files

fixed a cpu usage bug

  • Loading branch information...
1 parent 73c883e commit c0ca5d746f852b3a64c33293532f62ca14d385ca Jason Toy committed Jun 8, 2012
Showing with 3 additions and 5 deletions.
  1. +3 −5 lib/em-jack/connection.rb
View
8 lib/em-jack/connection.rb
@@ -230,11 +230,9 @@ def put(msg, opts = nil, &blk)
def each_job(timeout = nil, &blk)
if (@fiberized)
work = Proc.new do
- Fiber.new do
- job = reserve(timeout)
- blk.call(job)
- end.resume
- EM.next_tick { work.call }
+ job = reserve(timeout)
+ blk.call(job)
+ EM.next_tick { Fiber.new { work.call }.resume }
end
else
work = Proc.new do

0 comments on commit c0ca5d7

Please sign in to comment.