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

Replace goroutine with unlimited buffered channel #292

Closed
wants to merge 10 commits into from

Conversation

peterebden
Copy link
Member

As discussed, I think we have potential ordering issues by dispatching things in separate goroutines. That was necessary to avoid blocking when sending to a channel if the receiver is slow.

This removes the goroutine and replaces it with a self-buffering channel-like thing which should maintain send order.

Also did a bit of housekeeping (because I wanted to use Go 1.22 range-over-int, which needed several other updates)

@fische
Copy link
Contributor

fische commented Mar 25, 2024

Are we expecting more than a few events for a given action? If not, could we just make those channels buffered?

@peterebden
Copy link
Member Author

Don't the workers send a periodic update once a minute or so?

@peterebden
Copy link
Member Author

We could also get rid of that, or just have a buffer size of like 100 and deal with it if they fill up

@fische
Copy link
Contributor

fische commented Mar 25, 2024

Don't the workers send a periodic update once a minute or so?

Just had a quick look at the worker code and it looks like it only publishes when Executing and when Completed.

We could also get rid of that, or just have a buffer size of like 100 and deal with it if they fill up

Yeah we could even do that

@peterebden peterebden closed this Mar 25, 2024
@peterebden peterebden mentioned this pull request Mar 25, 2024
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