Class: Rooibos::Router::Flow::Outward

Inherits:
Object
  • Object
show all
Includes:
Dispatch
Defined in:
lib/rooibos/router/flow/outward.rb

Overview

Outward flow: messages traveling toward the root.

Observe → intercept → forward.

Constant Summary collapse

INTERCEPTED =

Sentinel: intercept consumed the bubble. Non-nil so Transition#with_command replaces the original Command::Bubble instead of preserving it via the nil no-op.

Object.new.freeze

Instance Method Summary collapse

Instance Method Details

#call(message, model) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/rooibos/router/flow/outward.rb', line 24

def call(message, model)
  transition = run_all(observes, message, model)
  config = Configuration.new(message:, model: transition.model)
  intercept_first_matching(receives, config, transition) ||
    apply_first_matching(forwards, config, transition) ||
    transition
end