Resource request with timeout
Is it possible to request resource with timeout.
Context: I'm trying to simulate impatience and I stumble upon situation, when an order is stuck for very long on resource request state, I've tried to look through the code but I havent found any possibility to add it easy, am I missing something?
Sure, the BankRenege sample shows exactly that feature. You can combine events using logical operators | (or) and & (and) which will wake up the process if any event fired (or) or only if all of them fired (and).
Hmm, is it possible to release not yet acquired resource?
Just release it. Request also implements IDisposable so you can use the using pattern to hold it, the dispose callback releases the request.