Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource request with timeout #45

Open
kokorins opened this issue Sep 7, 2024 · 3 comments
Open

Resource request with timeout #45

kokorins opened this issue Sep 7, 2024 · 3 comments

Comments

@kokorins
Copy link

kokorins commented Sep 7, 2024

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?

@abeham
Copy link
Member

abeham commented Sep 7, 2024

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).

@kokorins kokorins closed this as completed Sep 8, 2024
@kokorins kokorins reopened this Sep 8, 2024
@kokorins
Copy link
Author

kokorins commented Sep 8, 2024

Hmm, is it possible to release not yet acquired resource?

@abeham
Copy link
Member

abeham commented Sep 8, 2024

Just release it. Request also implements IDisposable so you can use the using pattern to hold it, the dispose callback releases the request.

@kokorins kokorins closed this as completed Sep 8, 2024
@kokorins kokorins reopened this Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants