class Async::Pool::Resource
The basic interface required by a pool resource.
def self.call
def self.call self.new end
def close
def close @closed = true end
def closed?
-
(Boolean)
- whether the resource has been closed or has failed.
def closed? @closed end
def initialize(concurrency = 1)
Create a new resource.
def initialize(concurrency = 1) @concurrency = concurrency @closed = false @count = 0 end
def reusable?
def reusable? !@closed end
def viable?
-
(Boolean)
- whether the resource can actually be used.
def viable? !@closed end