Code Monkey home page Code Monkey logo

async_simple's Introduction

async_simple

A Simple, Light-Weight Asynchronous C++ Framework

license language feature last commit

English | δΈ­ζ–‡

The async_simple is a library offering simple, light-weight and easy-to-use components to write asynchronous codes. The components offered include the Lazy (based on C++20 stackless coroutine), the Uthread (based on stackful coroutine) and the traditional Future/Promise.

Install Dependencies

The build of async_simple need libaio, googletest and cmake. Both libaio and googletest are optional. (Testing before using is highly suggested.)

Using apt (ubuntu and debian's)

# Install libaio
sudo apt install libaio-dev -y

# Install gtest
sudo apt install libgtest-dev -y
sudo apt install cmake -y
cd /usr/src/googletest/gtest
sudo mkdir build && cd build
sudo cmake .. && sudo make install
cd .. && sudo rm -rf build
cd /usr/src/googletest/gmock
sudo mkdir build && cd build
sudo cmake .. && sudo make install
cd .. && sudo rm -rf build

Using yum (CentOS and fedora)

# Install libaio
sudo yum install libaio-devel -y

sudo yum install cmake -y
# Try to build gtest and gmock from source

Using Homebrew (macOS)

brew install cmake
brew install googletest

Build Dependencies From Source

# libaio (optional)
# you can skip this if you install libaio from packages
git clone https://pagure.io/libaio.git
cd libaio
sudo make install
# gmock and gtest
git clone [email protected]:google/googletest.git -b v1.8.x
cd googletest
mkdir build && cd build
cmake .. && sudo make install

Install Clang Compiler

Required Compiler: clang (>= 11.0.1) or gcc (>= 10.3)

Demo example dependency

Demo example depends on standalone asio(https://github.com/chriskohlhoff/asio/tree/master/asio), the commit id:f70f65ae54351c209c3a24704624144bfe8e70a3

Build

$ mkdir build && cd build
# Specify [-DASYNC_SIMPLE_ENABLE_TESTS=OFF] to skip tests.
CXX=clang++ CC=clang cmake ../ -DCMAKE_BUILD_TYPE=[Release|Debug] [-DASYNC_SIMPLE_ENABLE_TESTS=OFF]
# for gcc, use CXX=g++ CC=gcc
make -j4
make test # optional
make install # sudo if required

Get Started

After installing and reading Lazy to get familiar with API, here is a demo use Lazy to count char in a file.

How to Contribute

  1. Read the How to fix issue document firstly.
  2. Run tests and git-clang-format HEAD^ locally for the change.
  3. Create a PR, fill in the PR template.
  4. Choose one or more reviewers from contributors: (ChuanqiXu9, RainMark, foreverhy, qicosmos).
  5. Get approved and merged.

Performance Monitoring

We could monitor the performance change history in: https://alibaba.github.io/async_simple/benchmark-monitoring/index.html.

License

async_simple is distributed under the Apache License (Version 2.0) This product contains various third-party components under other open source licenses. See the NOTICE file for more information.

async_simple's People

Contributors

alibaba-oss avatar chuanqixu9 avatar devillove084 avatar foreverhy avatar pikachuhy avatar qicosmos avatar rainmark 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.