-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Provide a [Timeout(TimeSpan)] attribute to specify timeouts for grain method calls #7837
Comments
We're moving this issue to the |
I really like this idea, and it would be a huge help to our team. In theory could something like this also work for the |
I think we should do this, or at least something similar. I'll keep this open for now as an alternative / complement to #7649 |
Imo it'd be more flexible to specify timeout imperatively via code rather than attribute with a static timeout value |
It would be more flexible. How do you imagine specifying it? The two main options which I see are:
Specifying the type from the call site could be accomplished using |
I'm not sure about the feasibility but I would imagine it like an extension method to either a task returned by a grain method (similar to
or
|
That would even make the timeout different per call. Another possibility could be to use I'm presuming it would be beneficial to know before each invocation what the timeout will be, especially in the light of the P.S. I am also in favor of not being constrained by attributes that need constant values. I prefer things like this to be configurable somehow, but I would be okay with this configuration being "static". |
Having a The As for attributes which reference a configurable policy, I think that is a viable approach. The difficulty will be in ensuring that the result is still very fast. Having a per-call dictionary lookup (eg, via DI) or additional allocations would be expensive. It can be done, but it will require a lot of work at the codegen level to generate efficient code. |
I propose a
[Timeout(TimeSpan)]
attribute that can be applied to a grain method to specify the timeout for that method call, overriding the default global timeout configured by theSiloMessagingOptions.ResponseTimeout
andClientMessagingOptions.ResponseTimeout
options.An infinite timeout could also be specified by decorating a method with
[Timeout(TimeSpan.InfiniteTimeSpan)]
. This could be used in place of the[LongRunning]
attribute proposed in #7649.This may also be relevant to #4328.
The text was updated successfully, but these errors were encountered: