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

feat: make Client send and sync #659

Draft
wants to merge 1 commit into
base: next
Choose a base branch
from
Draft

Conversation

tomyrd
Copy link
Collaborator

@tomyrd tomyrd commented Jan 9, 2025

related to #657

This PR adds Send and Sync to the traits used in the client. Some changes in miden-base were also needed.

This makes it so that the client can be shared between tokio tasks like the issue requested but the issue is not entirely solved. Mostly because the store and rpc traits are #[async_trait(?Send)] meaning that the futures they create are not send. This means that the client can be shared, but any method called will generate futures that won't be send. This doesn't seem like an issue but tokio need that all data that is held across .await calls is Send.

If we remove the ?Send from the async traits, the rust client works but not the web store and tonic client.

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