IronsDu / brynet

A Header-Only cross-platform C++ TCP network library . We can use vcpkg(https://github.com/Microsoft/vcpkg/tree/master/ports/brynet) install brynet.
MIT License
1.04k stars 241 forks source link

EventLoop 类可以脱离socket使用吗?比如我在其他业务场景使用 #137

Open qht1003077897 opened 1 year ago

IronsDu commented 1 year ago

可以的。它可以作为一个job task框架(A线程投递异步函数-即job 到EventLoop,B线程从此EventLoop中处理job-即执行异步函数)

IronsDu commented 1 year ago

folly等库里也有类似的,叫executor。

qht1003077897 commented 1 year ago

好的,我不想引入其他库的目的是为了让项目更轻,能复用的就复用。

IronsDu commented 1 year ago

如果你有用包管理的话,其实就无所谓,大胆的用,宜用尽用……