Class: Database::ConcurrentThreadPool::Proxy

Inherits:
BaseProxy
  • Object
show all
Defined in:
lib/sequel/extensions/concurrent_thread_pool.rb

Overview

Default proxy: schedules block via Concurrent::Future, blocks on first access.

Instance Method Summary collapse

Methods inherited from BaseProxy

#method_missing, #respond_to_missing?

Constructor Details

#initialize(executor, &block) ⇒ Proxy

Returns a new instance of Proxy.



27
28
29
30
31
# File 'lib/sequel/extensions/concurrent_thread_pool.rb', line 27

def initialize(executor, &block)
  super()

  @future = Concurrent::Promises.future_on(executor, &block)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Database::ConcurrentThreadPool::BaseProxy

Instance Method Details

#__valueObject



33
34
35
# File 'lib/sequel/extensions/concurrent_thread_pool.rb', line 33

def __value
  @future.value!
end