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

Try to cleanup the lock rats nest #47

Merged
merged 6 commits into from
Oct 18, 2023
Merged

Try to cleanup the lock rats nest #47

merged 6 commits into from
Oct 18, 2023

Conversation

pr2502
Copy link
Owner

@pr2502 pr2502 commented Oct 17, 2023

ra-mux was written pretty hastily when i wasn't still very comfortable with async and there were a bunch of questionable choices there.

let's try to clean it up so changes like #40 and the additional tracking that will be needed for #44 aren't so scary

- move the calls to `task::spawn` outside of the functions and remove
  methods, this helps make the task dependencies explicit.
- replace the `RwLock` with a `Mutex` since there is no reading
  concurrency anyway, only the `stdout_task` reads it.
- move removing closed client channels from GC task to the `stdout_task`
  which has to check for closed channels anyway for sending to them.
@pr2502 pr2502 changed the title Try to cleanup the lock rats lest Try to cleanup the lock rats nest Oct 18, 2023
@pr2502 pr2502 marked this pull request as ready for review October 18, 2023 22:05
@pr2502 pr2502 merged commit 18f7413 into main Oct 18, 2023
@pr2502 pr2502 deleted the cleanup branch October 18, 2023 22:06
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.

1 participant