Skip to content

Commit

Permalink
Merge pull request #63 from atolab/lifetime_removal
Browse files Browse the repository at this point in the history
docs: add a notice about entity lifetime parameter removal
  • Loading branch information
Mallets authored Sep 12, 2024
2 parents 1e08474 + c44aa0d commit d266917
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion content/docs/migration_1.0/Rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ publisher.put(buf).wait().unwrap();

## `Session` is now clonable and can be closed easily

`Session` implements `Clone` now, so there is no more need to wrap it into an `Arc<Session>`, and `Session::into_arc` has been deprecated. All the session methods, except `Session::close`, works like before, so only the session type will would to be changed.
`Session` implements `Clone` now, so there is no more need to wrap it into an `Arc<Session>`, and `Session::into_arc` has been deprecated. All the session methods, except `Session::close`, works like before, so only the session type need to be changed.
<br>
As a side effect, `Subscriber` and `Queryable` no longer have a generic lifetime parameter. `Publisher` also looses one of its lifetime parameters, to keep only the one of its key expression.

The session is now closed automatically when the last `Session` instance is dropped, **even if publishers/subscribers/etc. are still alive**. Session can also be manually closed using `Session::close`, which now takes an immutable reference, so it can be called anytime, even if publishers/subscribers/etc. are still alive.
<br>
Expand Down

0 comments on commit d266917

Please sign in to comment.