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(iroh): pass a runtime to Doc client to spawn close task on drop #1758

Merged
merged 4 commits into from
Oct 30, 2023

Conversation

dignifiedquire
Copy link
Contributor

@dignifiedquire dignifiedquire commented Oct 30, 2023

We spawn a tokio task when dropping a client Doc handle to notify the node that the document was closed. This does not work in the FFI currently because the FFI does not run in a global tokio context. Instead we now always pass a runtime::Handle into the client which can be used to spawn tasks independently of running in a tokio context.

@Frando Frando changed the title test(iroh): failing test for drop in sync land feat(iroh): allow to pass a runtime to Doc client to spawn close task on drop Oct 30, 2023
@Frando Frando marked this pull request as ready for review October 30, 2023 11:25
@Frando Frando changed the title feat(iroh): allow to pass a runtime to Doc client to spawn close task on drop feat(iroh): pass a runtime to Doc client to spawn close task on drop Oct 30, 2023
Copy link
Contributor Author

@dignifiedquire dignifiedquire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@dignifiedquire dignifiedquire added this to the v0.9.0 milestone Oct 30, 2023
@dignifiedquire dignifiedquire added this pull request to the merge queue Oct 30, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 30, 2023
@dignifiedquire dignifiedquire added this pull request to the merge queue Oct 30, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 30, 2023
@dignifiedquire dignifiedquire added this pull request to the merge queue Oct 30, 2023
@dignifiedquire dignifiedquire removed this pull request from the merge queue due to a manual request Oct 30, 2023
@dignifiedquire dignifiedquire added this pull request to the merge queue Oct 30, 2023
Merged via the queue into main with commit 0c145d5 Oct 30, 2023
15 checks passed
divagant-martian pushed a commit to divagant-martian/iroh that referenced this pull request Oct 31, 2023
…0-computer#1758)

We spawn a tokio task when dropping a client `Doc` handle to notify the
node that the document was closed. This does not work in the FFI
currently because the FFI does not run in a global tokio context.
Instead we now always pass a `runtime::Handle` into the client which can
be used to spawn tasks independently of running in a tokio context.

---------

Co-authored-by: Franz Heinzmann (Frando) <frando@unbiskant.org>
@dignifiedquire dignifiedquire deleted the fix-iroh-sync-drop branch November 1, 2023 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants