Azure / azure-storage-cpplite

Lite version of C++ Client Library for Microsoft Azure Storage
MIT License
25 stars 44 forks source link

Getting azure storage working with boost::asio framework #113

Closed jade2k11598 closed 3 years ago

jade2k11598 commented 3 years ago

Hi, I have an application that uses the boost::asio framework for a pool of threads, which works asynchronously. Is there a way of getting the azure-storage-cpplite to work asynchronously? I notice that the public interfaces return futures, which the examples given, just calls its get() function to acquire results, which will block (not desirable for asynchronous programming). Just looking for a way for this to work asynchronously such that when making the request to put a blob, one can provide it a handler to trigger when a response of that put is received.

Jinming-Hu commented 3 years ago

Hi @jade2k11598 , APIs in this cpplite sdk aren't guaranteed to be async. Returning std::future is a bad design, due to lack of consideration. This cpplite sdk is going to be deprecated in favor of Track2 storage sdk. So I suggest you switch to track2 sdk and start a new thread (or use a thread pool) for each put request.

jade2k11598 commented 3 years ago

Thanks @Jinming-Hu. Will look at the referenced alternative.