Skip to content

goto-opensource/asyncly

Repository files navigation

Asyncly

Asyncly

High level concurrency primitives for C++.


Never blocking: asyncly purposefully takes away all APIs that would allow your event loop to be blocked when waiting for an asynchronous operation to finish. We want to make it really easy to do the right thing and never block.

Works on top of your own runtime: asyncly works together with existing runtimes like boost::asio or libuv and makes it easy to plug in your own. This allows you to slowly migrate existing legacy code to high level concurrency primitives.

Composable: Primitives in asyncly are designed to compose well and support your software design instead of getting in the way.

Example

// asyncly does not contain an http client library,
// http is merely used as an example of an asynchronous operation
getHttpUrl("https://discovery/numberservice")
    .then([](auto responseFromDiscoveryService) {
        return getHttpUrl(responseFromDiscoveryService.body);
    })
    .then([](auto response) { std::cout << response.body << std::endl; })
    .catch_error([](auto exception) {
        try {
            std::rethrow_exception(exception);
        } catch (std::exception& e) {
            std::cout << e.what();
        });
    });

Features

  • Futures
  • Observables
  • Thread Pools
  • Executors
  • Object lifetime helpers
  • Experimental C++20 coroutine support
  • Multi platform support (used in production on these platforms)
    • Windows
    • MacOS
    • Linux
    • iOS
    • Android

Dependencies

  • C++20
  • Boost 1.81
  • prometheus-cpp
  • function2
  • Bazel or CMake

Contributing

See Contributing.md.

License

Apache 2.0

About

C++ concurrent programming library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages