Module: Concurrently::Debug
- Defined in:
- lib/all/concurrently/debug.rb
Overview
With Concurrently::Debug
the locations where concurrent procs are
entered, suspended, resumed and exited at can be logged. The log shows
the subsequent order in which concurrent procs are executed.
It looks like:
.---- BEGIN 94khk test/CRuby/event_loop_spec.rb:16
'-> SUSPEND 94khk lib/all/concurrently/proc/evaluation.rb:86:in `__suspend__'
... [other entries] ...
.--- RESUME 94khk lib/all/concurrently/proc/evaluation.rb:86:in `__suspend__'
'-----> END 94khk test/CRuby/event_loop_spec.rb:16
This log section indicates that the concurrent proc defined at
test/CRuby/event_loop_spec.rb:16
has been started to be evaluated. It is
assigned the id 94khk
. The code of the proc is evaluated until it is
suspended at lib/all/concurrently/proc/evaluation.rb:86
. After other
concurrent procs where scheduled to run, proc 94khk
is resumed again and
from there on is evaluated until its end.
Next to END
, there are two other variations how the evaluation of a
concurrent proc can be marked as concluded. These are
CANCEL
if the evaluation is prematurely concluded with Proc::Evaluation#conclude_to andERROR
if the evaluation raises an error.
The id of an evaluation may (and very likely will) be reused after the evaluation was concluded.
Class Method Summary collapse
-
.enable(logger, filter = false) ⇒ true
Enables debugging.
Class Method Details
.enable(logger, filter = false) ⇒ true
Enables debugging
58 59 60 61 62 63 64 |
# File 'lib/all/concurrently/debug.rb', line 58 def enable(logger, filter = false) @logger = logger @filter = filter @log_concurrently_gem = filter && filter.any?{ |f| f.include? @concurrently_path } @overwrites.each{ |overwrite| overwrite.call } true end |