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

synchronous call for client #82

Open
receiver1 opened this issue Jul 17, 2024 · 5 comments
Open

synchronous call for client #82

receiver1 opened this issue Jul 17, 2024 · 5 comments

Comments

@receiver1
Copy link

Hello library developer! I ask you to please add a synchronous call for the client. Asynchrony is not possible in all environments, so this will be very useful and I think not only for me.

@qchateau
Copy link
Owner

Hello, what upside so you see in having a blocking API while you can just async_call then run your io_context ?
Simplicity would obviously be one but an adapter would do to hide that

@receiver1
Copy link
Author

receiver1 commented Sep 9, 2024

Hello, what upside so you see in having a blocking API while you can just async_call then run your io_context ? Simplicity would obviously be one but an adapter would do to hide that

I use asio with 70% of its functionality disabled because in my environment the use of threads is prohibited and unavailable.

@qchateau
Copy link
Owner

qchateau commented Sep 10, 2024

Async doesn't need multiple threads, on the contrary it is most useful in single threaded contexts.
I don't know what you mean by "70% of asio disabled" but if you mean you restrict yourself to a subset of the features available then I can't accommodate such request as that set would be different for every potential user

@receiver1
Copy link
Author

Async doesn't need multiple threads, on the contrary it is most useful in single threaded contexts. I don't know what you mean by "70% of asio disabled" but if you mean you restrict yourself to a subset of the features available then I can't accommodate such request as that set would be different for every potential user

No, I mean that in Boost and Asio there are settings via defines. There is such a define as BOOST_DISABLE_THREADS, which disables threads, and accordingly all asynchronous calls. It would be very kind of you to implement a synchronous call on the client, since asynchronicity and threads are not supported in every runtime.

@qchateau
Copy link
Owner

Thanks for the context. Is there any other configuration macro you are interested in apart from ASIO_DISABLE_THREADS ?

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