How simonbrunel/qtpromise works
QtPromise is a header-oriented Promises/A+ implementation for Qt/C++. A caller creates or adapts asynchronous work into a promise, which settles with a value or error; continuations and collection helpers transform or combine results. Qt signal and QFuture adapters bridge Qt asynchronous APIs, while event-loop dispatch and shared promise state support delivery across threads. The README also documents timeout/delay, conversion and thread safety. Some implementations are unsampled, so links to those capabilities are omitted where wiring is uncertain.
Main entry points: qpromiseresolver.h Promise resolver · qpromise.inl Continuation chain · qpromise.h QPromise API · qpromise_p.h Promise state
Components 13
Promise lifecycle
- QPromise API
src/qtpromise/qpromise.h - Promise resolver
src/qtpromise/qpromiseresolver.h - Promise state
src/qtpromise/qpromise_p.h
Composition APIs
- Continuation chain
src/qtpromise/qpromise.inl - Collection helpers
src/qtpromise/qpromisehelpers.h - Helper internals
src/qtpromise/qpromisehelpers_p.h
Qt adapters
- Signal connections
src/qtpromise/qpromiseconnections.h - QFuture adapter
src/qtpromise/qpromisefuture.h
Dispatch and errors
- Promise exceptions
src/qtpromise/qpromiseexceptions.h - Callback traits
src/qtpromise/qpromiseglobal.h
Other components
- Library caller
- Qt Core
- Qt event loop
Connections 16
- Library caller → QPromise API: creates or chains
- QPromise API → Promise resolver: constructs resolver
- Promise resolver → Promise state: settles and dispatches
- Promise state → Continuation chain: notifies handlers
- Continuation chain → Promise resolver: resolves next
- QPromise API → Collection helpers: offers combinators
- Collection helpers → Continuation chain: composes promises
- Collection helpers → Helper internals: uses signal helpers
- Helper internals → Signal connections: tracks connections
- Helper internals → Qt Core: connects signals
- Signal connections → Qt Core: disconnects
- Library caller → QFuture adapter: provides QFuture
- QFuture adapter → Promise resolver: fulfills or rejects
- Promise state → Qt event loop: posts callbacks
- Promise resolver → Promise exceptions: rejects with errors
- Continuation chain → Callback traits: deduces callbacks