Synchronous Observer Pattern components for the Flowduino ESPressio Development Platform.
3.0.1
Version 3.0.1 preserves the Observable 3.0 public API and ownership-safe registration model while reducing the cost of optional observability when no Observers are registered.
ThreadSafeObservable now maintains a lightweight atomic Observer count so
ExecuteNotification() can return immediately without taking the notification
mutex or acquiring a notification-lifetime shared_ptr when there are no
Observers. Registration, unregistration, mutation-during-notification and RAII
handle semantics are unchanged.
ESPressio is a collection of discrete, composable component libraries built around a common development ethos:
- Light-weight --- minimise memory consumption and runtime overhead without sacrificing correctness.
- Ease of use --- provide strongly typed, developer-friendly abstractions over lower-level facilities.
- Object-oriented --- a type for everything, and everything in a type.
- SOLID --- favour focused responsibilities, extensibility, substitutable abstractions, narrow interfaces, and dependency inversion wherever practical on embedded C++ platforms.
Licensed under the Apache License 2.0. See LICENSE.
ESPressio is designed as a modular ecosystem of independently useful libraries, with required dependencies kept explicit and optional integrations introduced only when the corresponding functionality is selected.
For a complete overview of required dependencies, opt-in dependencies, and the overall hierarchy, see:
ESPressio Library Dependency Chart
- Solid relationships represent required ESPressio dependencies.
- Dashed relationships represent opt-in dependencies introduced only by the corresponding feature, integration, type, or header.
None.
ESPressio::ObservableObservable is intended for synchronous relationships between an operation and interested observers:
Observable
+--> Observer A
+--> Observer B
+--> Observer C
A subsystem normally defines a focused Observer interface derived from
the library's IObserver contract and exposes registration through its
Observable surface.
Version 3.x uses ownership-safe registration handles. Registrations can be explicitly removed and naturally follow the lifetime of their registration handles.
Observers remain non-owning: the application must keep an Observer alive for as long as it remains registered.
Observer callbacks execute synchronously as part of the notifying operation.
Use Observable when the notification belongs directly to the operation and an asynchronous task boundary is undesirable.
Use ESPressio Event when producers and consumers should be independently scheduled.
Observable does not depend on Event.
Higher-level bridges may consume synchronous Observer callbacks and emit asynchronous Events:
Timing / Threads
-> Observable callback
-> optional Event bridge
-> asynchronous Event
This dependency direction keeps foundational libraries independent.
- Focused Observer contracts.
- Explicit registration lifetime.
- Non-owning Observer relationships.
- Synchronous deterministic notification.
- Reusable infrastructure.
- No dependency on ESPressio Event.