The Observer
Subscribing to trace generation milestones.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Observer
ARCANUM SCHOOL: Divination // Omniscience
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CAIRO PATTERN //
trait IObserver<T> { fn update(self: @T, message: felt252); }
#[derive(Drop)]
struct TraceSubject { observers: Array<felt252> } // IDs of observers
trait ISubject {
fn notify_all(self: @TraceSubject, message: felt252);
}
impl SubjectImpl of ISubject {
fn notify_all(self: @TraceSubject, message: felt252) {
// Loop and notify
}
}
Allows multiple ethereal entities to watch and react as the STARK proof unfolds.
Runic Tags:
#cairo
#design-pattern
#observer