Class: Hlsv::AnalysisRegistry

Inherits:
Object
  • Object
show all
Defined in:
lib/hlsv/analysis_registry.rb

Overview

Keeps completed SdtmValidation instances in memory, keyed by study name.

Historically this was the only way to generate html/docx/excel reports on demand. Since '/proceed' now generates all report formats up front (see AnalysisRunner), this registry is no longer on the main path: it only serves as a fallback

  • to regenerate a report format that failed to generate during '/proceed' (see the per-format rescue blocks there), or
  • for the per-dataset Excel export ('/report/:study/excel/:dataset'), which is still generated on click rather than pre-generated.

This is process-local, in-memory state: it is lost on server restart and is not shared across multiple server processes. That's an accepted trade-off for a single-user local tool. If this ever needs to survive restarts or run behind multiple workers, this is the place to swap the storage for something persistent.

Class Method Summary collapse

Class Method Details

.fetch!(study_name) ⇒ Object



31
32
33
34
# File 'lib/hlsv/analysis_registry.rb', line 31

def fetch!(study_name)
  mutex.synchronize { engines[study_name] } ||
    raise(Hlsv::Error, "No analysis found in memory for '#{study_name}'. Please re-run the analysis.")
end

.store(study_name, engine) ⇒ Object



27
28
29
# File 'lib/hlsv/analysis_registry.rb', line 27

def store(study_name, engine)
  mutex.synchronize { engines[study_name] = engine }
end