Rebex.Net.WebClient, asynchronous operation.

0 votes
asked May 6 by luthfi (150 points)

Hi, I’m starting my evaluation today. Is there any implementation to call download/upload asynchronously using Rebex.Net.WebClient?

I'm currently wrapping those synchronous call using Task.Run. AFAIK, exposing a method that is truly synchronous using an asynchronous API is considered a bad practice.

Thank you.

1 Answer

0 votes
answered May 6 by Lukas Matyska (52,730 points)
selected May 6 by luthfi
 
Best answer

Hello,

Unfortunately, the Rebex.Net.WebClient has no asynchronous methods. It is replacement for the System.Net.WebClient, which has EAP (event-async-pattern), which has been obsoleted.
We want to add some true-asynchronous API to our WebClient, but we have no schedule for it yet.

Although async-over-sync is not good practice as you correctly mentioned, it is suggested solution in case you need to perform the operation asynchronously to free the current thread.

Actually, the async API for HttpRequest class is currently async-over-sync. We have plan to make it true-async.

...