FubarDevelopment / restsharp.portable

Some kind of a RestSharp port to PCL
BSD 2-Clause "Simplified" License
96 stars 33 forks source link

AsyncLock #75

Closed yaliashkevich closed 7 years ago

yaliashkevich commented 8 years ago

if cancelation token is already cancelled when you pass it to clien.Execute() following exception occurs:

  at System.Threading.CancellationTokenSource.get_WaitHandle () <0x10035b720 + 0x00040> in <filename unknown>:0 
  at System.Threading.CancellationToken.get_WaitHandle () <0x10035a560 + 0x00033> in <filename unknown>:0 
  at RestSharp.Portable.AsyncLock+<>c__DisplayClass4_0.<LockAsync>b__0 () <0x1010d0320 + 0x0006b> in <filename unknown>:0 
  at System.Threading.Tasks.Task.InnerInvoke () <0x100367530 + 0x0005f> in <filename unknown>:0 
  at System.Threading.Tasks.Task.Execute () <0x100366d80 + 0x00043> in <filename unknown>:0 

It doesn't crash my xamarin app, but I'm constantly receive this crash report (unobserved task exception).

Question: Is it possible to configure restclient (http) to ignore "shared" logic? I always create new instance for each request and don't need this async lock/guard logic at all

fubar-coder commented 8 years ago

Currently, you cannot disable this shared logic. The AsyncLock gets removed with version 4.0 in the hope, that the HttpClient allows concurrent requests which will be required for HTTP 2.0 support.

ggirard07 commented 8 years ago

in the hope, that the HttpClient allows concurrent requests

@fubar-coder Is there something wrong with current HttpClient for concurrent requests? I will be very interested in if you have any references about those :)

fubar-coder commented 8 years ago

The library behaved very strangely (see issue #19)

ggirard07 commented 7 years ago

@fubar-coder just do confirm, did you remove the AsyncLock in the v4 release? I wasn't able to find any reference to it since the v4 branch merge

fubar-coder commented 7 years ago

Yes, the AsyncLock is gone.