Module: Textus::Application::Read::GetOrRefresh

Defined in:
lib/textus/application/read/get_or_refresh.rb

Overview

Composes pure ‘Read::Get` with the refresh orchestrator: runs Get to obtain the envelope and freshness verdict, then if the verdict is stale and the rule’s ‘on_stale` policy demands action, hands off to the orchestrator. Use for interactive reads where the caller wants the freshest obtainable envelope.

Pure reads (build, projection, schema tooling) should use ‘Read::Get` directly; it has no orchestrator dependency.

Defined Under Namespace

Classes: Impl

Class Method Summary collapse

Class Method Details

.call(session:, ctx:, caps:) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/textus/application/read/get_or_refresh.rb', line 13

def self.call(*, session:, ctx:, caps:, **)
  Impl.new(
    caps: caps,
    get: Read::Get::Impl.new(ctx: ctx, caps: caps),
    orchestrator: session.refresh_orchestrator,
  ).call(*, **)
end