-
Notifications
You must be signed in to change notification settings - Fork 20
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
Log a warning for slow signal updates to subscribers #116
base: 0.5.X
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1111,7 +1111,7 @@ pub enum EntryReadAccess<'a> { | |
Err(&'a Metadata, ReadError), | ||
} | ||
|
||
impl<'a> EntryReadAccess<'a> { | ||
impl EntryReadAccess<'_> { | ||
pub fn datapoint(&self) -> Result<&Datapoint, ReadError> { | ||
match self { | ||
Self::Entry(entry) => Ok(&entry.datapoint), | ||
|
@@ -1151,7 +1151,7 @@ pub struct EntryReadIterator<'a, 'b> { | |
permissions: &'b Permissions, | ||
} | ||
|
||
impl<'a, 'b> Iterator for EntryReadIterator<'a, 'b> { | ||
impl<'a> Iterator for EntryReadIterator<'a, '_> { | ||
type Item = EntryReadAccess<'a>; | ||
|
||
#[inline] | ||
|
@@ -1167,7 +1167,7 @@ impl<'a, 'b> Iterator for EntryReadIterator<'a, 'b> { | |
} | ||
} | ||
|
||
impl<'a, 'b> DatabaseReadAccess<'a, 'b> { | ||
impl DatabaseReadAccess<'_, '_> { | ||
pub fn get_entry_by_id(&self, id: i32) -> Result<&Entry, ReadError> { | ||
match self.db.entries.get(&id) { | ||
Some(entry) => match self.permissions.can_read(&entry.metadata.path) { | ||
|
@@ -1203,7 +1203,7 @@ impl<'a, 'b> DatabaseReadAccess<'a, 'b> { | |
} | ||
} | ||
|
||
impl<'a, 'b> DatabaseWriteAccess<'a, 'b> { | ||
impl DatabaseWriteAccess<'_, '_> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you changed from explicit lifetimes to anonymous lifetimes? did it complain? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is inherited from #114, see also https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes As we use "latest and greatest" clippy we get these types of regressions now and then (long term we could discuss if we rather should have a fixed rust/clippy/fmt version and perform updates only when preparing for a (major) release, to reduce the risk of regressions) |
||
pub fn update_by_path( | ||
&mut self, | ||
path: &str, | ||
|
@@ -1397,7 +1397,7 @@ impl Database { | |
} | ||
} | ||
|
||
impl<'a, 'b> query::CompilationInput for DatabaseReadAccess<'a, 'b> { | ||
impl query::CompilationInput for DatabaseReadAccess<'_, '_> { | ||
fn get_datapoint_type(&self, path: &str) -> Result<DataType, query::CompilationError> { | ||
match self.get_metadata_by_path(path) { | ||
Some(metadata) => Ok(metadata.data_type.to_owned()), | ||
|
@@ -1670,10 +1670,13 @@ impl<'a, 'b> AuthorizedAccess<'a, 'b> { | |
.await | ||
.add_change_subscription(subscription); | ||
|
||
let stream = BroadcastStream::new(receiver).filter_map(|result| match result { | ||
let stream = BroadcastStream::new(receiver).filter_map(move |result| match result { | ||
Ok(message) => Some(message), | ||
Err(err) => { | ||
debug!("Lagged entries: {}", err); | ||
warn!( | ||
"Slow subscriber with capacity {} lagged and missed signal updates: {}", | ||
channel_capacity, err | ||
); | ||
None | ||
} | ||
}); | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
It would be better with "0.5.1-dev.1" (or "0.5.1-dev.0") as it is not a pre-release to 0.5.0 but rather a possible pre-release to an upcoming 0.5.1
https://github.com/eclipse-kuksa/kuksa-databroker/wiki/Release-Process#proposed-versioning-scheme