Class: Yoda::Server::LifecycleHandler::InitializationProgressReporter
- Inherits:
-
Object
- Object
- Yoda::Server::LifecycleHandler::InitializationProgressReporter
- Defined in:
- lib/yoda/server/lifecycle_handler.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(progress_reporter) ⇒ InitializationProgressReporter
constructor
A new instance of InitializationProgressReporter.
- #notify_build_library_registry(message: nil, name: nil, version: nil) ⇒ Object
- #notify_initialization_progress(phase: nil, message: nil, index:, length:) ⇒ Object
Constructor Details
#initialize(progress_reporter) ⇒ InitializationProgressReporter
Returns a new instance of InitializationProgressReporter.
226 227 228 |
# File 'lib/yoda/server/lifecycle_handler.rb', line 226 def initialize(progress_reporter) @progress_reporter = progress_reporter end |
Instance Attribute Details
#progress_reporter ⇒ Providers::ReportableProgress::ProgressReporter (readonly)
223 224 225 |
# File 'lib/yoda/server/lifecycle_handler.rb', line 223 def progress_reporter @progress_reporter end |
Instance Method Details
#notify_build_library_registry(message: nil, name: nil, version: nil) ⇒ Object
242 243 244 |
# File 'lib/yoda/server/lifecycle_handler.rb', line 242 def notify_build_library_registry(message: nil, name: nil, version: nil) progress_reporter.report(message: ) end |
#notify_initialization_progress(phase: nil, message: nil, index:, length:) ⇒ Object
230 231 232 233 234 235 236 237 238 239 240 |
# File 'lib/yoda/server/lifecycle_handler.rb', line 230 def notify_initialization_progress(phase: nil, message: nil, index:, length:) if length && length > 0 percentage = (index || 0) * 100 / length progress_reporter.report(message: , percentage: percentage) else progress_reporter.report(message: ) end progress_reporter.notifier.event(type: :initialization, phase: phase, message: ) end |