Skip to content

Waiters #292

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

Open
wants to merge 39 commits into
base: decaf
Choose a base branch
from
Open

Waiters #292

wants to merge 39 commits into from

Conversation

richardwang1124
Copy link

@richardwang1124 richardwang1124 commented Apr 24, 2025

Description of changes:
Initial implementation of waiters.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

end
expect_any_instance_of(waiter).to receive(:delay).and_wrap_original do |m, *args|
delay = m.call(*args)
expect(delay).to equal(5)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test case is an example of the question I had in my doc regarding waiter retries. Because the remaining time (5) minus the delay (value between min delay of 3 and max delay of 4) is less than the min delay, the final delay value is set to be equal to the remaining time, which is 5. However, this exceeds the max delay. Is this expected behavior?

Copy link
Contributor

@mullermp mullermp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start!

}.to raise_error(no_such_waiter_error)
end

it 'does not allow custom waiters' do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. While true, I guess this documents that? I don't think it's needed but you can keep it if you want. I did not add one for paginators.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on whether or not we want to support registering new custom waiters this test case may be modified or removed.

@mullermp mullermp marked this pull request as ready for review May 5, 2025 22:48
Copy link
Contributor

@jterapin jterapin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Great work so far - mini-review since you are working through changes and etc.

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

Successfully merging this pull request may close these issues.

3 participants