Skip to content

erehw/cocoflow

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Concurrency Control Flow 并发流程控制

A C++ framework is based on coroutine and libuv, just using start, await, all_of, any_of to control flow.

一个基于协程和libuv的C++框架,仅通过 startawaitall_ofany_of 控制流程。

  • 示例:你需要等待两个udp的recv事件,并且需要设置一个超时时间,则你可以用使用:

await (
    any_of (
        all_of (
            udp0.recv,
            udp1.recv
        ),
        sleep(x ms)
    )
)

Documents: wiki

To build:

Prerequisites (Linux):

* GCC 4.2 or newer
* Python 2.6 or 2.7
* GNU Make 3.81 or newer
* (All of above is for libuv)

Linux:

make

Prerequisites (Windows):

* UnZip (You can extract dependencies by other tools)
* Python 2.6 or 2.7
* Visual Studio 2008 or 2010 or 2012

Windows:

run vcbuild.bat

To run the tests:

Linux:

make test

Windows:

run vc\test.bat

License

(The LGPL License)