Class: DeepTest::NullWorkerListener

Inherits:
Object
  • Object
show all
Defined in:
lib/deep_test/null_worker_listener.rb

Overview

Listener that implements no-ops for all callbacks that DeepTest supports.

Direct Known Subclasses

Database::SetupListener

Instance Method Summary collapse

Instance Method Details

#before_starting_workersObject

Before DeepTest starts any workers, it instantiates a listener and invokes this method. No other callbacks are made to the listener instance receiving this message.



19
20
# File 'lib/deep_test/null_worker_listener.rb', line 19

def before_starting_workers
end

#before_syncObject

Before DeepTest synchronizes any code during a distributed run, before_sync is called. If DeepTest is not running distributed, before_sync is never called.



11
12
# File 'lib/deep_test/null_worker_listener.rb', line 11

def before_sync
end

#finished_work(worker, work_unit, result) ⇒ Object

Each time a worker finishes computing a result for a work unit, it calls this method before sending that result back to the server. In total, this method will be called as many times as there are work units. The listener instance that received the starting callback with the worker provided here is the same instance that receives this message.

Because each work processes work units in a serial fashion, the listener will receive a starting_work message before another finished_work message.



59
60
# File 'lib/deep_test/null_worker_listener.rb', line 59

def finished_work(worker, work_unit, result)
end

#starting(worker) ⇒ Object

A separate listener instance is created in each worker process and notified that the worker is starting. The worker for the process is provided for the listener to use. If you are using 3 workers, this method is invoked 3 times on 3 distinct instances. These instances will also receive the starting_work and finished_work callbacks for the worker provided.



30
31
# File 'lib/deep_test/null_worker_listener.rb', line 30

def starting(worker)
end

#starting_work(worker, work_unit) ⇒ Object

Each time a worker takes a work unit, it calls this method before doing the work. In total, this method will be called as many times as there are work units. The listener instance that received the starting callback with the worker provided here is the same instance that receives this message.

Because each work processes work units in a serial fashion, the listener will receive a finished_work message before another starting_work message.



44
45
# File 'lib/deep_test/null_worker_listener.rb', line 44

def starting_work(worker, work_unit)
end