Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #16 from jtoy/master

fix cpu usage bug
  • Loading branch information...
commit 00cea919a3f567ee324d61e2e03e865c420f3838 2 parents 73c883e + c0ca5d7
@dj2 dj2 authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.