Class: Tasker::Registry::BaseRegistry

Inherits:
Object
  • Object
show all
Includes:
Concerns::StructuredLogging
Defined in:
lib/tasker/registry/base_registry.rb

Overview

Base class for all registry systems in Tasker

Provides common functionality including thread-safe operations, structured logging, health checks, and statistics interfaces. All registry classes should inherit from this base class.

Constant Summary

Constants included from Concerns::StructuredLogging

Concerns::StructuredLogging::CORRELATION_ID_KEY

Instance Method Summary collapse

Methods included from Concerns::StructuredLogging

#correlation_id, #correlation_id=, #log_exception, #log_orchestration_event, #log_performance_event, #log_step_event, #log_structured, #log_task_event, #with_correlation_id

Constructor Details

#initializeBaseRegistry

Returns a new instance of BaseRegistry.



17
18
19
20
21
22
# File 'lib/tasker/registry/base_registry.rb', line 17

def initialize
  @mutex = Mutex.new
  @telemetry_config = Tasker::Configuration.configuration.telemetry
  @registry_name = self.class.name.demodulize.underscore
  @created_at = Time.current
end

Instance Method Details

#all_itemsHash

Get all items in the registry

Returns:

  • (Hash)

    All registered items

Raises:

  • (NotImplementedError)

    Must be implemented by subclasses



164
165
166
# File 'lib/tasker/registry/base_registry.rb', line 164

def all_items
  raise NotImplementedError, 'Subclasses must implement #all_items'
end

#clear!void

This method returns an undefined value.

Clear all items from the registry

Raises:

  • (NotImplementedError)

    Must be implemented by subclasses



172
173
174
# File 'lib/tasker/registry/base_registry.rb', line 172

def clear!
  raise NotImplementedError, 'Subclasses must implement #clear!'
end

#statsHash

Get comprehensive statistics for this registry

Returns:

  • (Hash)

    Registry-specific statistics

Raises:

  • (NotImplementedError)

    Must be implemented by subclasses



156
157
158
# File 'lib/tasker/registry/base_registry.rb', line 156

def stats
  raise NotImplementedError, 'Subclasses must implement #stats'
end