#1:
The entire point of WaitOne
here is to allow people to write synchronous code that waits for completion; if you don't need to use methods like WaitOne
, WaitAny
etc - then don't use them; that's fine.
#2:
In both cases, whether it uses a dedicated thread, or whether it completes via some other callback, yes it blocks a thread: it blocks the thread that has requested to be blocked by calling WaitOne
. If you don't want that: don't call WaitOne
.
Aside: since you specify 4.0, you might find it more intuitive to return a Task<T>
instead, using TaskCompletionSource<T>
. Edit: I realize now that this isn't an option due to satisfying the IHttpAsyncHandler.BeginProcessRequest
method.