-
Notifications
You must be signed in to change notification settings - Fork 32
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
Hide extra functionality from ServerEventQueue
#164
Conversation
f5d08f3
to
e3a6fe5
Compare
e3a6fe5
to
6c99614
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #164 +/- ##
==========================================
+ Coverage 83.37% 90.68% +7.31%
==========================================
Files 20 19 -1
Lines 1287 1181 -106
==========================================
- Hits 1073 1071 -2
+ Misses 214 110 -104 ☔ View full report in Codecov by Sentry. |
src/network_event/server_event.rs
Outdated
/// Inserts a new event. | ||
/// | ||
/// The event will be queued until [`Self::pop_next`] is called with a replicon tick >= the tick specified here, | ||
/// or until [`Self::clear`] is called. | ||
/// The event will be queued until [`RepliconTick`] will be bigger or equal to the tick specified here. |
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 event will be queued until [`RepliconTick`] will be bigger or equal to the tick specified here. | |
/// The event will be queued until [`RepliconTick`] is bigger or equal to the tick specified here. |
src/network_event/server_event.rs
Outdated
/// Pops the next event that is at least as old as the specified replicon tick. | ||
pub fn pop_next(&mut self, replicon_tick: RepliconTick) -> Option<T> { | ||
let (tick, _) = self.0.front()?; | ||
if *tick > replicon_tick { | ||
return None; | ||
} | ||
self.0.pop_front().map(|(_, event)| event) | ||
} |
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.
I would prefer to keep this and just change the visibility, to isolate implementation details from other parts of the code.
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.
Agree, but I adjusted the name a little bit.
Co-authored-by: UkoeHB <37489173+UkoeHB@users.noreply.github.com>
In discord we discussed customization without the full access to
ServerEventQueue
.