diff --git a/Cargo.lock b/Cargo.lock index c2ceb0c..214f38f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -856,7 +856,7 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "orchestra" -version = "0.3.7" +version = "0.4.0" dependencies = [ "async-trait", "criterion", @@ -878,7 +878,7 @@ dependencies = [ [[package]] name = "orchestra-proc-macro" -version = "0.3.7" +version = "0.4.0" dependencies = [ "anyhow", "assert_matches", diff --git a/Cargo.toml b/Cargo.toml index 5fdb89e..f0a1a02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ resolver = "2" [workspace.package] authors = ["Parity Technologies "] edition = "2021" -version = "0.3.7" +version = "0.4.0" readme = "README.md" license = "MIT OR Apache-2.0" repository = "https://github.com/paritytech/orchestra" diff --git a/orchestra/Cargo.toml b/orchestra/Cargo.toml index c884e94..ebc5a6b 100644 --- a/orchestra/Cargo.toml +++ b/orchestra/Cargo.toml @@ -15,7 +15,7 @@ futures = "0.3" async-trait = "0.1" thiserror = "1" metered = { package = "prioritized-metered-channel", version = "0.6.1", path = "../metered-channel", default-features = false } -orchestra-proc-macro = { version = "0.3.5", path = "./proc-macro" } +orchestra-proc-macro = { version = "0.4.0", path = "./proc-macro" } futures-timer = "3.0.2" pin-project = "1.0" dyn-clonable = "0.9" diff --git a/orchestra/proc-macro/src/impl_channels_out.rs b/orchestra/proc-macro/src/impl_channels_out.rs index 25883af..5fa9647 100644 --- a/orchestra/proc-macro/src/impl_channels_out.rs +++ b/orchestra/proc-macro/src/impl_channels_out.rs @@ -77,7 +77,7 @@ pub(crate) fn impl_channels_out_struct(info: &OrchestraInfo) -> Result( + pub async fn send_and_log_error( &mut self, signals_received: usize, message: #message_wrapper @@ -87,12 +87,12 @@ pub(crate) fn impl_channels_out_struct(info: &OrchestraInfo) -> Result { match P::priority() { - PriorityLevel::Normal => { + #support_crate ::PriorityLevel::Normal => { self. #channel_name .send( #support_crate ::make_packet(signals_received, #maybe_boxed_send) ).await }, - PriorityLevel::High => { + #support_crate ::PriorityLevel::High => { self. #channel_name .priority_send( #support_crate ::make_packet(signals_received, #maybe_boxed_send) ).await @@ -125,7 +125,7 @@ pub(crate) fn impl_channels_out_struct(info: &OrchestraInfo) -> Result( + pub fn try_send( &mut self, signals_received: usize, message: #message_wrapper, @@ -135,12 +135,12 @@ pub(crate) fn impl_channels_out_struct(info: &OrchestraInfo) -> Result { match P::priority() { - PriorityLevel::Normal => { + #support_crate ::PriorityLevel::Normal => { self. #channel_name .try_send( #support_crate ::make_packet(signals_received, #maybe_boxed_send) ) }, - PriorityLevel::High => { + #support_crate ::PriorityLevel::High => { self. #channel_name .try_priority_send( #support_crate ::make_packet(signals_received, #maybe_boxed_send) ) diff --git a/orchestra/proc-macro/src/impl_subsystem_ctx_sender.rs b/orchestra/proc-macro/src/impl_subsystem_ctx_sender.rs index 1d93591..0b4afee 100644 --- a/orchestra/proc-macro/src/impl_subsystem_ctx_sender.rs +++ b/orchestra/proc-macro/src/impl_subsystem_ctx_sender.rs @@ -278,10 +278,10 @@ pub(crate) fn impl_subsystem_sender( { async fn send_message(&mut self, msg: OutgoingMessage) { - self.send_message_with_priority::(msg).await; + self.send_message_with_priority::<#support_crate ::NormalPriority>(msg).await; } - async fn send_message_with_priority(&mut self, msg: OutgoingMessage) + async fn send_message_with_priority(&mut self, msg: OutgoingMessage) { self.channels.send_and_log_error::

( self.signals_received.load(), @@ -293,10 +293,10 @@ pub(crate) fn impl_subsystem_sender( fn try_send_message(&mut self, msg: OutgoingMessage) -> ::std::result::Result<(), #support_crate ::metered::TrySendError> { - self.try_send_message_with_priority::(msg) + self.try_send_message_with_priority::<#support_crate ::NormalPriority>(msg) } - fn try_send_message_with_priority(&mut self, msg: OutgoingMessage) -> ::std::result::Result<(), #support_crate ::metered::TrySendError> + fn try_send_message_with_priority(&mut self, msg: OutgoingMessage) -> ::std::result::Result<(), #support_crate ::metered::TrySendError> { self.channels.try_send::

( self.signals_received.load(),