MCPcopy Create free account
hub / github.com/aws/clock-bound / feed_inner

Method feed_inner

clock-bound/src/daemon/clock_sync_algorithm.rs:109–130  ·  view source on GitHub ↗

Convenience function to allow for easy instrumenting

(&mut self, routable_event: RoutableEvent)

Source from the content-addressed store, hash-verified

107
108 /// Convenience function to allow for easy instrumenting
109 fn feed_inner(&mut self, routable_event: RoutableEvent) -> Option<&ClockParameters> {
110 // First route the event to the correct inner source
111 let alg_output = match routable_event {
112 RoutableEvent::LinkLocal(event) => Self::feed_link_local(&mut self.link_local, event),
113 RoutableEvent::NtpSource(sender_address, event) => {
114 Self::feed_ntp_source(&mut self.ntp_sources, sender_address, event)
115 }
116 RoutableEvent::Phc(event) => {
117 // unwrap: feeding a phc event without PHC built is a bug
118 let phc = self.phc.as_mut().unwrap();
119 Self::feed_phc(phc, event)
120 }
121 };
122 let (clock_parameters, source_info) = alg_output?;
123
124 let output = self.selector.update(clock_parameters, source_info);
125 if output.is_some() {
126 Self::update_selected_clock(&self.selected_clock, source_info);
127 }
128
129 output
130 }
131
132 // wrapper around feed_inner that emits reproducibility
133 fn feed_repro(&mut self, routable_event: RoutableEvent) -> Option<&ClockParameters> {

Callers 1

feed_reproMethod · 0.80

Calls 2

update_selected_clockFunction · 0.85
updateMethod · 0.80

Tested by

no test coverage detected