Class: Rooibos::Message::Batch

Inherits:
Data
  • Object
show all
Includes:
Predicates
Defined in:
lib/rooibos/message/batch.rb

Overview

Completion sentinel from Command.batch.

Batch commands stream child messages live. When all children finish, this message signals completion. Use it to trigger follow-up actions or UI updates after parallel work completes.

Example

case msg
in Message::Batch
  out.put(:all_done)
in [:progress, pct]
  model.with(progress: pct)
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Predicates

#==, #method_missing, #respond_to_missing?, #to_sym

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Rooibos::Message::Predicates

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command

Returns:

  • (Object)

    the current value of command



25
26
27
# File 'lib/rooibos/message/batch.rb', line 25

def command
  @command
end

Instance Method Details

#batch?Boolean

Returns true for batch completion messages.

Returns:

  • (Boolean)


29
30
31
# File 'lib/rooibos/message/batch.rb', line 29

def batch?
  true
end

#deconstruct_keys(_keys) ⇒ Object

Deconstructs for pattern matching.



34
35
36
# File 'lib/rooibos/message/batch.rb', line 34

def deconstruct_keys(_keys)
  { type: :batch, command: }
end