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 tokio Mutexes with sync Mutexes #168

Merged
merged 4 commits into from
Mar 25, 2023
Merged

Replace tokio Mutexes with sync Mutexes #168

merged 4 commits into from
Mar 25, 2023

Conversation

lipanski
Copy link
Owner

@lipanski lipanski commented Mar 25, 2023

Closes #166

This MR replaces the tokio Mutexes/RwLocks with the sync Mutex/RwLock which is preferred as long as the sync Mutex is not held across await calls.

Since the server state is now wrapped in a sync Mutex, there's no need to call block_on inside the Drop implementations any more.

It also replaces the tokio oneshot channel that shares the server port with a sync mpsc channel. This was the cause for the server pool blocking on futures::future::join_all.

@lipanski lipanski changed the title fix join all v2 Replace Tokio Mutexes with sync Mutexes Mar 25, 2023
@lipanski lipanski changed the title Replace Tokio Mutexes with sync Mutexes Replace tokio Mutexes with sync Mutexes Mar 25, 2023
@lipanski lipanski merged commit 627d938 into master Mar 25, 2023
@lipanski lipanski deleted the fix-join-all-v2 branch March 25, 2023 20:03
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.

Test using parallel async mocks hangs
1 participant