Update the firewheel context. This must be called regularly (i.e. once every frame).
(&mut self)
| 811 | /// Retrieve the latest performance profiling data. |
| 812 | pub fn profiling_data(&mut self) -> &ProfilingData { |
| 813 | self.profiler_rx.fetch_info() |
| 814 | } |
| 815 | |
| 816 | /// Update the firewheel context. |
| 817 | /// |
| 818 | /// This must be called regularly (i.e. once every frame). |
| 819 | pub fn update(&mut self) -> Result<(), UpdateError> { |
| 820 | self.logger_rx.flush( |
| 821 | |msg| { |
| 822 | #[cfg(feature = "tracing")] |
| 823 | tracing::error!("{}", msg); |
| 824 | |
| 825 | #[cfg(all(feature = "log", not(feature = "tracing")))] |
| 826 | log::error!("{}", msg); |
| 827 | |
| 828 | let _ = msg; |
| 829 | }, |
| 830 | |msg| { |
| 831 | #[cfg(feature = "tracing")] |
| 832 | tracing::debug!("{}", msg); |
| 833 | |
| 834 | #[cfg(all(feature = "log", not(feature = "tracing")))] |
| 835 | log::debug!("{}", msg); |
| 836 | |
| 837 | let _ = msg; |
| 838 | }, |
| 839 | ); |
| 840 | |
| 841 | firewheel_core::collector::GlobalRtGc::collect(); |
| 842 | |
| 843 | for msg in self.from_processor_rx.pop_iter() { |
| 844 | match msg { |
| 845 | ProcessorToContextMsg::DropEventGroup(mut event_group) => { |
| 846 | event_group.clear(); |
| 847 | self.event_group_pool.push(event_group); |
| 848 | } |
| 849 | ProcessorToContextMsg::DropSchedule(schedule_data) => { |
| 850 | self.graph.drop_old_schedule_data(schedule_data); |
| 851 | } |
| 852 | #[cfg(feature = "musical_transport")] |
| 853 | ProcessorToContextMsg::DropTransportState(transport_state) => { |
| 854 | if self.transport_state_alloc_reuse.is_none() { |
| 855 | self.transport_state_alloc_reuse = Some(transport_state); |
| 856 | } |
| 857 | } |
| 858 | #[cfg(feature = "scheduled_events")] |
| 859 | ProcessorToContextMsg::DropClearScheduledEvents(msgs) => { |
| 860 | let _ = msgs; |
| 861 | } |
| 862 | } |
| 863 | } |
| 864 | |
| 865 | self.graph |
| 866 | .update(self.stream_info.as_ref(), &mut self.event_group); |
| 867 | |
| 868 | if self.is_active() { |
| 869 | if self.graph.needs_compile() { |
| 870 | let schedule_data = self.graph.compile(self.stream_info.as_ref().unwrap())?; |
nothing calls this directly
no test coverage detected