From abd02e9e7fefc4f099908dc2779bb5d069328919 Mon Sep 17 00:00:00 2001 From: Alexandru Gheorghe Date: Mon, 29 Jan 2024 12:20:00 +0200 Subject: [PATCH] fixup! Implement separate signal and message flows (#66) --- orchestra/proc-macro/src/impl_subsystem_ctx_sender.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/orchestra/proc-macro/src/impl_subsystem_ctx_sender.rs b/orchestra/proc-macro/src/impl_subsystem_ctx_sender.rs index 708a008..22d01a8 100644 --- a/orchestra/proc-macro/src/impl_subsystem_ctx_sender.rs +++ b/orchestra/proc-macro/src/impl_subsystem_ctx_sender.rs @@ -495,9 +495,13 @@ pub(crate) fn impl_subsystem_context_trait_for( } async fn recv_signal(&mut self) -> ::std::result::Result<#signal, #error_ty> { - self.signals.next().await.ok_or(#support_crate ::OrchestraError::Context( + let result = self.signals.next().await.ok_or(#support_crate ::OrchestraError::Context( "Signal channel is terminated and empty.".to_owned(), - ).into()) + ).into()); + if let Ok(_) = result { + self.signals_received.inc(); + } + result } fn sender(&mut self) -> &mut Self::Sender {