Over the past few months, we've looked at asynchronous I/O and network programming using Boost.Asio and Boost.Beast. Those libraries connect to your application through the use of callbacks. When orchestrating a sequence of asynchronous operations, it is up to the application to ensure that the callbacks are invoked in the proper sequence.
This "callback hell" problem has long been recognized in the JavaScript world, as all I/O operations in JavaScript (timers or XML HTTP Requests) are asynchronous. In the JavaScript world this lead to promise oriented APIs that allowed for a more linear notation in expressing a sequence of asynchronous operations. This led to the Promises/A+ specification for JavaScript promises.
Promise-cpp is an implementation of the Promises/A+ specification for C++. It can integrate with Boost.Asio and Boost.Beast for asynchronous network programming support for low-level I/O as well as HTTP and WebSocket APIs.
Example code: https://github.com/LegalizeAdulthood/...
Promise-Cpp: https://github.com/xhawk18/promise-cpp
Past topics: https://utahcpp.wordpress.com/past-me...
Future topics: https://utahcpp.wordpress.com/future-...
Meetup group: https://www.meetup.com/utah-cpp-progr...
Watch video Promise-Cpp with Boost.Beast online without registration, duration hours minute second in high quality. This video was added by user Utah Cpp Programmers 14 June 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 94 once and liked it 1 people.