Module: Taski::TestHelper::WorkerPoolExtension Private

Included in:
Execution::WorkerPool
Defined in:
lib/taski/test_helper.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Module prepended to WorkerPool to skip execution of mocked tasks.

Instance Method Summary collapse

Instance Method Details

#drive_fiber(task_class, wrapper, queue) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



67
68
69
70
71
72
73
74
75
76
77
# File 'lib/taski/test_helper.rb', line 67

def drive_fiber(task_class, wrapper, queue)
  return if @registry.abort_requested?

  if MockRegistry.mock_for(task_class)
    wrapper.mark_completed(nil) unless wrapper.completed?
    @completion_queue.push(Taski::Execution::FiberProtocol::TaskCompleted.new(task_class, wrapper))
    return
  end

  super
end