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

Add the ability to specify a default timeout if the header was not received or was incorrect #2

Open
ulbwa opened this issue Sep 14, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ulbwa
Copy link
Owner

ulbwa commented Sep 14, 2024

something like

countdown: DeadlineCountdown(default_timeout=float)
@ulbwa ulbwa added the enhancement New feature or request label Sep 14, 2024
@ulbwa
Copy link
Owner Author

ulbwa commented Sep 14, 2024

For now it is possible to specify default_timeout for process middleware, which will perform exactly this. DeadlineCountdown is an annotation, so need to rewrite it into a function that will return an annotation. The question is how to get this default_timeout from the parameter in DeadlineCountdown

@ulbwa
Copy link
Owner Author

ulbwa commented Sep 14, 2024

Moreover, functions cannot be called in type annotations, so this needs to be implemented either through Annotated metadata or as a default parameter value, e.g, countdown: DeadlineCountdown = DefaultCountdown(float) or Annotated[DeadlineCountdown, DefaultCountdown(float)]. We can get signature from context.get("handler_"), but I don’t understand how to retrieve the “filtered” handler, and there may be more than one. It seems that the simplest way would be to implement a mapping of the subject to a default timeout in process middleware args

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant