Replies: 2 comments
-
Hi @curunoir thanks for your note and your kind words. Sync requests and responses should, in general, be used with bounded request and response sizes. I wouldn't encourage you to use it with a potentially large request or response body. What I would recommend as an alternative is to set some identifier in your request and use the normal asynchronous |
Beta Was this translation helpful? Give feedback.
-
Thanks I will dig with these elements :) |
Beta Was this translation helpful? Give feedback.
-
Hi,
I know my question may be strange so I will explain my use case but first of all thanks to the contributors of this usefull library.
My use case is that a client wants a server to request an URI (mostly with HttpClient) and returns its synchronously. As the content behind requested uri may be large and the server has low memory resources streams should be needed. Unfortunately my client can't run fully asynchronously and I have to use Task.Result in order to force server response to be synchronous.
Steps could be
Problem with my first implementation is that if client is using SendAndWaitAsync, it will receive a SyncResponse. If server initiates a SendAsync with MemoryStream as long as it reads HttpClient.GetStreamAsync chunks client will receive it on its StreamReceived callback but I don't figure how I could fit my use case with my client waiting synchronously a response to its first request.
I hope it is clear enough, thanks for watching. :)
Beta Was this translation helpful? Give feedback.
All reactions