Skip to content
New issue

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

关于执行线程的问题 #117

Open
alfred-lijun opened this issue Jan 18, 2024 · 3 comments
Open

关于执行线程的问题 #117

alfred-lijun opened this issue Jan 18, 2024 · 3 comments

Comments

@alfred-lijun
Copy link

我发现register_handler绑定的函数,或者subscribe监听的函数,实际上都被执行在rest_rpc内部的异步线程中,这其实带来一些不便,很多场景函数的执行被别的库强制要求在主线程,如果上面两个函数能执行在new rpc_server和new rpc_client时所在的线程就好了!

@qicosmos
Copy link
Owner

可以handler内部用其它线程池。

@alfred-lijun
Copy link
Author

没搜到多少关于handler的关键字,在哪修改,能给点代码么,求指导一下

@qicosmos
Copy link
Owner

https://github.com/qicosmos/rest_rpc/blob/master/examples/server/main.cpp#L83C15-L83C15
这个例子里用的是线程,你需要改成线程池。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants