packio icon indicating copy to clipboard operation
packio copied to clipboard

synchronous call for client

Open receiver1 opened this issue 1 year ago • 5 comments

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.

receiver1 avatar Jul 17 '24 12:07 receiver1

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

qchateau avatar Aug 31 '24 10:08 qchateau

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.

receiver1 avatar Sep 09 '24 12:09 receiver1

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

qchateau avatar Sep 10 '24 16:09 qchateau

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.

receiver1 avatar Sep 18 '24 11:09 receiver1

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

qchateau avatar Sep 18 '24 16:09 qchateau