/lib_co

a c++ continue library

Primary LanguageCApache License 2.0Apache-2.0

一个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