Class: Events::StartMneme

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

Overview

Emitted by MeleteEnrichmentJob when goals changed during the Melete run, signalling that Mneme should recall against the fresh goal set. Mneme subscribes via Events::Subscribers::MnemeKickoff, performs associative recall, enqueues its memories as background PendingMessages, and emits StartProcessing to continue the drain.

Second stage of the start_melete → (start_mneme) → start_processing chain. Conditional — when goals are untouched the pipeline jumps straight from StartMelete to StartProcessing.

Constant Summary collapse

TYPE =
"session.start_mneme"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session_id:, pending_message_id:) ⇒ StartMneme

Returns a new instance of StartMneme.

Parameters:

  • session_id (Integer)

    session whose drain pipeline should start

  • pending_message_id (Integer)

    the PendingMessage that triggered the chain



20
21
22
23
# File 'lib/events/start_mneme.rb', line 20

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

Instance Attribute Details

#pending_message_idObject (readonly)

Returns the value of attribute pending_message_id.



16
17
18
# File 'lib/events/start_mneme.rb', line 16

def pending_message_id
  @pending_message_id
end

#session_idObject (readonly)

Returns the value of attribute session_id.



16
17
18
# File 'lib/events/start_mneme.rb', line 16

def session_id
  @session_id
end

Instance Method Details

#event_nameObject



25
26
27
# File 'lib/events/start_mneme.rb', line 25

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

#to_hObject



29
30
31
# File 'lib/events/start_mneme.rb', line 29

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