lib/em-synchrony/connection_pool.rb in em-synchrony-0.3.0.beta.1 vs lib/em-synchrony/connection_pool.rb in em-synchrony-1.0.0

- old
+ new

@@ -46,11 +46,11 @@ # resume any other pending connections (which will # immediately try to run acquire on the pool) def release(fiber) @available.push(@reserved.delete(fiber.object_id)) - if pending = @pending.pop + if pending = @pending.shift pending.resume end end # Allow the pool to behave as the underlying connection @@ -60,14 +60,14 @@ # pool release whenever the request is complete. Otherwise # yield the connection within execute method and release # once it is complete (assumption: fiber will yield until # data is available, or request is complete) # - def method_missing(method, *args) + def method_missing(method, *args, &blk) async = (method[0,1] == "a") execute(async) do |conn| - df = conn.send(method, *args) + df = conn.send(method, *args, &blk) if async fiber = Fiber.current df.callback { release(fiber) } df.errback { release(fiber) }