Class: Events::Subscribers::MnemeKickoff

Inherits:
Object
  • Object
show all
Includes:
Events::Subscriber
Defined in:
lib/events/subscribers/mneme_kickoff.rb

Overview

Entry subscriber for the Mneme stage of the drain pipeline. On Events::StartMneme, enqueues MnemeEnrichmentJob to run associative recall asynchronously.

Instance Method Summary collapse

Instance Method Details

#emit(event) ⇒ Object

Parameters:

  • event (Hash)

    Rails.event notification hash



12
13
14
15
16
17
18
19
20
21
# File 'lib/events/subscribers/mneme_kickoff.rb', line 12

def emit(event)
  payload = event[:payload]
  session_id = payload[:session_id]
  return unless session_id

  MnemeEnrichmentJob.perform_later(
    session_id,
    pending_message_id: payload[:pending_message_id]
  )
end