✨ ARCANUM RUNE DIFFICULTY: Adept Behavioral

The Scrying Observer

Monitor an MQ queue and notify subscribers.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Observer
ARCANUM SCHOOL: Divination // Scrying
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
/* ooRexx Observer */
::class MQMonitor
::attribute observers
::method init
  self~observers = .array~new()
::method addObserver
  use arg obs
  self~observers~append(obs)
::method notifyObservers
  use arg msg
  do obs over self~observers
    obs~update(msg)
  end

::class LoggingObserver
::method update
  use arg msg
  say "Log: Received MQ message:" msg

The scrying orb of the Observer pattern watches the MQ depths, automatically pushing psychic alerts to all registered daemon tasks upon a new arrival.

Runic Tags: #observer #mq #rexx