-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
在示例中有看到使用一个均衡routine来按accept顺序在不同执行器中创建协程的实现,如果我的需求是多个执行器执行完当前协程后,自动获取最新的就绪的协程,实现按协程状态自动平衡的话,是否有可能实现?
https://github.com/archibate/co_async/blob/master/examples/server_mt.cpp
while (true) {
if (auto income = co_await listener_accept(listener)) [[likely]] {
workers[i].spawn(server.handle_http(std::move(*income)));
++i;
if (i >= workers.size()) {
i = 0;
}
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels