class Sequel::Database::AsyncThreadPool::BaseProxy

Base proxy object class for jobs processed by async threads and the returned result.

Public Class Methods

new(&block) click to toggle source

Store a block that returns the result when called.

    # File lib/sequel/extensions/async_thread_pool.rb
238 def initialize(&block)
239   ::Kernel.raise Error, "must provide block for an async job" unless block
240   @block = block
241 end

Public Instance Methods

__value() click to toggle source

Wait for the value to be loaded if it hasn’t already been loaded. If the code to load the return value raised an exception that was wrapped, reraise the exception.

    # File lib/sequel/extensions/async_thread_pool.rb
267 def __value
268   unless defined?(@value)
269     __get_value
270   end
271 
272   if @value.is_a?(WrappedException)
273     ::Kernel.raise @value
274   end
275 
276   @value
277 end
method_missing(*args, &block) click to toggle source

Pass all method calls to the returned result.

    # File lib/sequel/extensions/async_thread_pool.rb
244 def method_missing(*args, &block)
245   __value.public_send(*args, &block)
246 end
respond_to_missing?(*args) click to toggle source

Delegate respond_to? calls to the returned result.

    # File lib/sequel/extensions/async_thread_pool.rb
252 def respond_to_missing?(*args)
253   __value.respond_to?(*args)
254 end