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

Request Timeouts #54

Open
IGJoshua opened this issue Sep 4, 2020 · 0 comments
Open

Request Timeouts #54

IGJoshua opened this issue Sep 4, 2020 · 0 comments

Comments

@IGJoshua
Copy link
Collaborator

IGJoshua commented Sep 4, 2020

Functionality should be added to all rest endpoints which allows timeouts to be specified, such that any request which takes longer than the timeout will be ignored and the promise returned will be realized with a default or user-specified value.

Currently, I think I should edit the defendpoint macro to include a :timeout and :timeout-value parameters. :timeout will be a number or channel, if a number it will create a timeout channel with that many milliseconds, otherwise it will be assumed to be a promise-chan which will yield an item when the timeout is reached.

The defendpoint functions will then spin up an additional go block which will take on that channel and upon receiving a value will put that value or :timeout-value onto the returned promise.

Additionally, make-request! should be updated to throw out a request if the :timeout channel can yield an item.

@IGJoshua IGJoshua added this to the Version 1.3 milestone Sep 4, 2020
@IGJoshua IGJoshua removed this from the Version 1.4 milestone Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant