Module: FTW::Poolable

Included in:
Connection
Defined in:
lib/ftw/poolable.rb

Overview

A poolable mixin. This is for use with the FTW::Pool class.

Instance Method Summary collapse

Instance Method Details

#available?Boolean

Is this resource available for use?

Returns:

  • (Boolean)


16
17
18
# File 'lib/ftw/poolable.rb', line 16

def available?
  return !@__in_use
end

#markObject

Mark that this resource is in use



6
7
8
# File 'lib/ftw/poolable.rb', line 6

def mark
  @__in_use = true
end

#releaseObject

Release this resource



11
12
13
# File 'lib/ftw/poolable.rb', line 11

def release
  @__in_use = false
end