Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Guess I'm late to the party. I would add two things: </p> <ol> <li>ManualResetEvent is IDisposable. So you need to make sure it gets disposed somewhere. </li> <li>Error handling - if one of the queries fails it'll probably fail the whole thing. You should probably retry failed requests. Alternatively you could return the values you did get back with some indication of which queries failed, so that the caller could retry the queries. </li> <li>Client side timeouts - there are none. This isn't a problem if the server side times out for you, but if that ever fails (eg, network issues) the client will hang forever. </li> </ol> <p>Also, I think this is actually a better approach that the Task Parallel Library. I tried the Task-per-query approach before this. The code was actually more awkward, and it tended to result in having a <em>lot</em> of active threads. I still haven't tested extensively with your code, but it seems to work better on first blush. </p> <h2>Update</h2> <p>I've put some work into a more-or-less rewrite of the code above. My rewrite removes all locking, supports client-side timeouts of hung transactions (rare, but it does happen, and can really ruin your day), and some exception handling logic. There is a full solution with tests up on <a href="https://bitbucket.org/breischl/sepialabs.azure/src" rel="nofollow">Bitbucket</a>. The most relevant code lives in <a href="https://bitbucket.org/breischl/sepialabs.azure/src/0f92178ab98e/Sepialabs.Azure/ParallelTableQuery.cs" rel="nofollow">one file</a>, though it does require some helpers that are in other parts of the project. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload