Skip to content

Commit

Permalink
Fix using unimported priority structs (#81)
Browse files Browse the repository at this point in the history
* Fix using unimported priority structs

* Bump v0.4.0
  • Loading branch information
AndreiEres authored Jun 11, 2024
1 parent e2c0265 commit 3906536
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resolver = "2"
[workspace.package]
authors = ["Parity Technologies <[email protected]>"]
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"
2 changes: 1 addition & 1 deletion orchestra/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions orchestra/proc-macro/src/impl_channels_out.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub(crate) fn impl_channels_out_struct(info: &OrchestraInfo) -> Result<proc_macr
// when no defined messages in enum
impl ChannelsOut {
/// Send a message via a bounded channel.
pub async fn send_and_log_error<P: Priority>(
pub async fn send_and_log_error<P: #support_crate ::Priority>(
&mut self,
signals_received: usize,
message: #message_wrapper
Expand All @@ -87,12 +87,12 @@ pub(crate) fn impl_channels_out_struct(info: &OrchestraInfo) -> Result<proc_macr
#feature_gates
#message_wrapper :: #consumes_variant ( inner ) => {
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
Expand Down Expand Up @@ -125,7 +125,7 @@ pub(crate) fn impl_channels_out_struct(info: &OrchestraInfo) -> Result<proc_macr
}

/// Try to send a message via a bounded channel.
pub fn try_send<P: Priority>(
pub fn try_send<P: #support_crate ::Priority>(
&mut self,
signals_received: usize,
message: #message_wrapper,
Expand All @@ -135,12 +135,12 @@ pub(crate) fn impl_channels_out_struct(info: &OrchestraInfo) -> Result<proc_macr
#feature_gates
#message_wrapper :: #consumes_variant ( inner ) => {
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)
)
Expand Down
8 changes: 4 additions & 4 deletions orchestra/proc-macro/src/impl_subsystem_ctx_sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@ pub(crate) fn impl_subsystem_sender(
{
async fn send_message(&mut self, msg: OutgoingMessage)
{
self.send_message_with_priority::<NormalPriority>(msg).await;
self.send_message_with_priority::<#support_crate ::NormalPriority>(msg).await;
}

async fn send_message_with_priority<P: Priority>(&mut self, msg: OutgoingMessage)
async fn send_message_with_priority<P: #support_crate ::Priority>(&mut self, msg: OutgoingMessage)
{
self.channels.send_and_log_error::<P>(
self.signals_received.load(),
Expand All @@ -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<OutgoingMessage>>
{
self.try_send_message_with_priority::<NormalPriority>(msg)
self.try_send_message_with_priority::<#support_crate ::NormalPriority>(msg)
}

fn try_send_message_with_priority<P: Priority>(&mut self, msg: OutgoingMessage) -> ::std::result::Result<(), #support_crate ::metered::TrySendError<OutgoingMessage>>
fn try_send_message_with_priority<P: #support_crate ::Priority>(&mut self, msg: OutgoingMessage) -> ::std::result::Result<(), #support_crate ::metered::TrySendError<OutgoingMessage>>
{
self.channels.try_send::<P>(
self.signals_received.load(),
Expand Down

0 comments on commit 3906536

Please sign in to comment.