zswDev / lib_co

a c++ continue library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

一个C++11 协程事件循环库 和 nodejs 的 co 框架类似,不过有工作线程池

TODO:

Timer function

example:

    ./run main.cpp

New writing method;

    Chan ch;
    co([]()->void{
        auto v = yield [&]()->void* {
            c_write(ch, 123); // golang_channel
            // TODO Asynchronous task, Run in thread pool
            return null;
        }
        cout<<v<<endl;
    })
    co([]()->void{
        auto v = yield [&]()->void* {
            auto v = c_read(ch)
            cout<<v<<endl;
            // TODO Asynchronous task, Run in thread pool
            return null;
        }
        cout<<v<<endl;
    })
    loop();

a c++11 continue library and event loop library

About

a c++ continue library

License:Apache License 2.0


Languages

Language:C 62.8%Language:C++ 23.7%Language:Assembly 13.5%