Class: APIHub::LeadScore::Async
- Inherits:
-
Object
- Object
- APIHub::LeadScore::Async
- Defined in:
- lib/apihub/lead_score/async.rb
Instance Attribute Summary collapse
-
#pool ⇒ Object
readonly
Returns the value of attribute pool.
Class Method Summary collapse
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize(options = {}) ⇒ Async
constructor
A new instance of Async.
- #lookup(email, &block) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Async
Returns a new instance of Async.
21 22 23 |
# File 'lib/apihub/lead_score/async.rb', line 21 def initialize( = {}) @pool = [:pool] || Thread.pool(8) end |
Instance Attribute Details
#pool ⇒ Object (readonly)
Returns the value of attribute pool.
19 20 21 |
# File 'lib/apihub/lead_score/async.rb', line 19 def pool @pool end |
Class Method Details
.finish ⇒ Object
14 15 16 17 |
# File 'lib/apihub/lead_score/async.rb', line 14 def self.finish instance.finish @instance = nil end |
.instance ⇒ Object
6 7 8 |
# File 'lib/apihub/lead_score/async.rb', line 6 def self.instance @instance ||= self.new end |
.lookup(email, &block) ⇒ Object
10 11 12 |
# File 'lib/apihub/lead_score/async.rb', line 10 def self.lookup(email, &block) instance.lookup(email, &block) end |
Instance Method Details
#finish ⇒ Object
31 32 33 |
# File 'lib/apihub/lead_score/async.rb', line 31 def finish pool.shutdown end |