We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
网络的一些操作还是基于epoll的异步回调的,比如connector中的非阻塞连接行为, 能否具有类似 connect().then([] { onSuccess(); }) 的同步调用模式呢? 另外,同步阻塞操作的异步化都是通过线程池的方式实现的,这里能不能考虑使用协程而不是线程来避免线程上下文切换的开销呢?
connect().then([] { onSuccess(); })
The text was updated successfully, but these errors were encountered:
第一个建议很好,考虑过,由于功能优先级问题搁置了,后续会改动,目前是事件驱动onConnect回调。另一个小原因是当时不想让网络库跟future过多耦合,鉴于future使用有一点门槛。
由于cpp没有内置协程而且macos上swapcontext不正常,放弃了。另外hook系统调用也是个技巧活,不太想陷入其中。如果有好的建议欢迎pr,谢谢
Sorry, something went wrong.
No branches or pull requests
网络的一些操作还是基于epoll的异步回调的,比如connector中的非阻塞连接行为, 能否具有类似
connect().then([] { onSuccess(); })
的同步调用模式呢?另外,同步阻塞操作的异步化都是通过线程池的方式实现的,这里能不能考虑使用协程而不是线程来避免线程上下文切换的开销呢?
The text was updated successfully, but these errors were encountered: