Subject

class foronoi.observers.subject.Subject

An observable subject that you can attach observers to.

attach_observer(observer: foronoi.observers.observer.Observer)

Attach an observer to the subject.

Parameters

observer (Observer) – An observer to attach to this subject

detach_observer(observer: foronoi.observers.observer.Observer)

Detach an observer from the subject.

Parameters

observer (Observer) – An observer to remove from this subject

get_observers()

Getter for observers

inherit_observers_from(parent)

Make this subject inherit observers from a parent. When the child sends an update to the observers, the parent will be passed as the sender.

Parameters

parent (Subject) – The parent to inherit observers from

notify_observers(message, **kwargs)

Notify all observers about an event.

Parameters

message (Message) – The message type