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 subscription events that are emitted when a queue is paused or resumed #328

Closed
wants to merge 1 commit into from

Conversation

brandur
Copy link
Contributor

@brandur brandur commented May 2, 2024

Here, largely as a potential way to resolve #324, add new events
EventKindQueuePaused and EventKindQueueResumed which are emitted
whenever a queue is paused or resumed. Tests will be able to use these
to wait on the completion of these actions even if calls to QueuePause
or QueueResume are asynchronous (as they are currently), or if the
pause/resume was initiated by a different client. I expect them to also
be useful for general telemetry/logging purposes.

Recall that when we first designed the subscription API, we explicitly
did not add a way to subscribe to all possible event types. This means
that although the new queue events fill Event.Queue instead of
Event.Job and Event.JobStats, the API is still forward compatible
because nobody could be listening to these yet.

…sumed

Here, largely as a potential way to resolve #324, add new events
`EventKindQueuePaused` and `EventKindQueueResumed` which are emitted
whenever a queue is paused or resumed. Tests will be able to use these
to wait on the completion of these actions even if calls to `QueuePause`
or `QueueResume` are asynchronous (as they are currently), or if the
pause/resume was initiated by a different client. I expect them to also
be useful for general telemetry/logging purposes.

Recall that when we first designed the subscription API, we explicitly
_did not_ add a way to subscribe to all possible event types. This means
that although the new queue events fill `Event.Queue` instead of
`Event.Job` and `Event.JobStats`, the API is still forward compatible
because nobody could be listening to these yet.
@brandur
Copy link
Contributor Author

brandur commented May 2, 2024

@bgentry Wrote this on the airplane before seeing you'd done it already. Opening PR for posterity.

@bgentry
Copy link
Contributor

bgentry commented May 2, 2024

Should be superseded by the updated #327.

@bgentry bgentry closed this May 2, 2024
@bgentry bgentry deleted the brandur-queue-pause-resume-events branch May 2, 2024 21:28
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.

None yet

2 participants