Git Product home page Git Product logo

asyncly's Introduction

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++14
  • Boost 1.72
  • prometheus-cpp
  • function2
  • Bazel or CMake

Contributing

See Contributing.md.

License

Apache 2.0

asyncly's People

Contributors

gjasny avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.