Module: LlmLogs::Batch::HandlerRegistry

Defined in:
app/models/llm_logs/batch/handler_registry.rb

Overview

Maps a batch purpose (e.g. “chat_summary”) to a handler object. Handlers respond to ‘call(request, message)` for successful results and `on_failure(request, error)` for failed/expired requests. The gem owns the lifecycle; the host app owns handlers.

Class Method Summary collapse

Class Method Details

.clear!Object



19
20
21
# File 'app/models/llm_logs/batch/handler_registry.rb', line 19

def clear!
  @handlers = {}
end

.register(purpose, handler) ⇒ Object



11
12
13
# File 'app/models/llm_logs/batch/handler_registry.rb', line 11

def register(purpose, handler)
  @handlers[purpose.to_s] = handler
end

.resolve(purpose) ⇒ Object



15
16
17
# File 'app/models/llm_logs/batch/handler_registry.rb', line 15

def resolve(purpose)
  @handlers[purpose.to_s]
end