-
Notifications
You must be signed in to change notification settings - Fork 172
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
'complete' option in PublicationCache, refactoring #688
Conversation
@{login} If this pull request contains a bugfix or a new feature, then please consider using |
This broke The usage of #[async_std::main]
async fn main() {
use zenoh::prelude::r#async::*;
use zenoh_ext::SessionExt;
let session = zenoh::open(Config::default())
.res()
.await
.unwrap()
.into_arc();
let publication_cache = session
.declare_publication_cache("key/expression")
.res()
.await
.unwrap();
async_std::task::spawn(async move {
publication_cache.key_expr();
});
} |
@OlivierHecart Fixed missing implementation of |
@@ -499,135 +562,49 @@ impl Session { | |||
pub fn config(&self) -> &Notifier<Config> { | |||
self.runtime.config() | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually a sneaky breaking change: the SessionDeclarations
trait will have to be in scope for the methods to be called on Session
, whereas this is currently unnecessary.
While I agree this makes a lot of sense, we should probably have a quick internal chat about whether or not we want to make that break (we have other more localized breaking changes in the next release, so I'm open to it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lifetime handling looks correct to me (GATs could have been another way to reach the solution, but this pattern also allows some nice variance tricks if we ever need them).
There's a sneaky breaking change by moving some of Session
's method to a trait. I think moving to the trait makes a lot of sense, but we might also want to re-add the intrinsic methods to avoid the breaking change.
This review will be updated to approved when a decision has been made regarding this breaking change.
Michael Ilyin — Today at 11:04 AM If even core API, like declare_publisher is implemented in a trait outside the Session, this makes SessionExt extension first class citizen. It's now not a some hack to add new methods to Session, but completely valid and supported way to extend it. Pierre 'Fox' Avital — Today at 11:08 AM |
PublicationCache
SessionRef
object: added mthods for creating publisher, queryable, etc to it. This allowed to access theSessionRef
without code duplication just to satisfy borrow checkerSessionExt
traitCloses 'rust' checkbox of #668