Class: Events::SubagentEvicted

Inherits:
Object
  • Object
show all
Defined in:
lib/events/subagent_evicted.rb

Overview

Emitted when Mneme::Runner advances the boundary past every remaining trace of a sub-agent — the spawn pair plus every from_{nickname} phantom pair. Subscribers broadcast the removal so clients drop the entry from the HUD panel.

session_id is the parent session (HUD owner), child_id is the sub-agent session whose traces just aged out.

Constant Summary collapse

TYPE =
"subagent.evicted"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session_id:, child_id:) ⇒ SubagentEvicted

Returns a new instance of SubagentEvicted.

Parameters:

  • session_id (Integer)

    parent session whose HUD should drop the entry

  • child_id (Integer)

    sub-agent session whose traces were evicted



18
19
20
21
# File 'lib/events/subagent_evicted.rb', line 18

def initialize(session_id:, child_id:)
  @session_id = session_id
  @child_id = child_id
end

Instance Attribute Details

#child_idObject (readonly)

Returns the value of attribute child_id.



14
15
16
# File 'lib/events/subagent_evicted.rb', line 14

def child_id
  @child_id
end

#session_idObject (readonly)

Returns the value of attribute session_id.



14
15
16
# File 'lib/events/subagent_evicted.rb', line 14

def session_id
  @session_id
end

Instance Method Details

#event_nameObject



23
24
25
# File 'lib/events/subagent_evicted.rb', line 23

def event_name
  "#{Bus::NAMESPACE}.#{TYPE}"
end

#to_hObject



27
28
29
# File 'lib/events/subagent_evicted.rb', line 27

def to_h
  {type: TYPE, session_id:, child_id:}
end