-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
By default, Sessions contain a borrow into their Context. This is correct, because the underlying implementation is allowed to have pointer pointing back at their context. However, this makes them harder to use from multiple threads, as a non-static reference is inherently not Send. This provides `OwnedSession`, behind the `owned` feature, which keeps a reference counted hold on the context backing the session to prevent it from being moved or dropped until the session leaves scope. This way, the `OwnedSession` can be transferred to another thread which does not know how long the original thread would keep the context around.
- Loading branch information
Showing
4 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters