From 7e6c82675ec0d14b987ca86a15ad19f704cf4717 Mon Sep 17 00:00:00 2001 From: verma nakul Date: Mon, 27 Jan 2025 21:21:13 +0530 Subject: [PATCH] [ISSUE #2419] Adding #[inline] for RocketMQRuntime method (#2420) --- rocketmq-runtime/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rocketmq-runtime/src/lib.rs b/rocketmq-runtime/src/lib.rs index 63152f24..99a284b5 100644 --- a/rocketmq-runtime/src/lib.rs +++ b/rocketmq-runtime/src/lib.rs @@ -22,6 +22,7 @@ pub enum RocketMQRuntime { } impl RocketMQRuntime { + #[inline] pub fn new_multi(threads: usize, name: &str) -> Self { Self::Multi( tokio::runtime::Builder::new_multi_thread() @@ -35,30 +36,35 @@ impl RocketMQRuntime { } impl RocketMQRuntime { + #[inline] pub fn get_handle(&self) -> &tokio::runtime::Handle { match self { Self::Multi(runtime) => runtime.handle(), } } + #[inline] pub fn get_runtime(&self) -> &tokio::runtime::Runtime { match self { Self::Multi(runtime) => runtime, } } + #[inline] pub fn shutdown(self) { match self { Self::Multi(runtime) => runtime.shutdown_background(), } } + #[inline] pub fn shutdown_timeout(self, timeout: Duration) { match self { Self::Multi(runtime) => runtime.shutdown_timeout(timeout), } } + #[inline] pub fn schedule_at_fixed_rate( &self, task: F, @@ -93,6 +99,7 @@ impl RocketMQRuntime { } } + #[inline] pub fn schedule_at_fixed_rate_mut( &self, mut task: F,