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

HeartbeatRoutine: return context.CancelFunc instead of chan struct{} #997

Merged
merged 1 commit into from
Jan 6, 2024

Conversation

serprex
Copy link
Contributor

@serprex serprex commented Jan 5, 2024

context.WithCancel is a bit hairy in its implementation since internally they use a lazily allocated chan struct{} themselves, but seems idiomatic to use it

HeartbeatRoutine could keep creating its own chan struct{} & instead return func() { close(shutdown) } to keep the same API

@serprex serprex enabled auto-merge (squash) January 5, 2024 23:20
@serprex serprex merged commit 081eb40 into main Jan 6, 2024
7 checks passed
iskakaushik added a commit that referenced this pull request Jan 7, 2024
Amogh-Bharadwaj added a commit that referenced this pull request Jan 7, 2024
iskakaushik added a commit that referenced this pull request Jan 7, 2024
iskakaushik pushed a commit that referenced this pull request Jan 7, 2024
serprex added a commit that referenced this pull request Jan 8, 2024
#1020 reverted #997

Reimplement so only func declaration moves into HeartbeatRoutine
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.

2 participants