Skip to content

Commit 4a68474

Browse files
committed
[ISSUE #269]⚡️Replace impl Trait with async in RemotingService
1 parent cf9e766 commit 4a68474

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

rocketmq-remoting/src/remoting.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717

1818
use crate::{net::ResponseFuture, protocol::remoting_command::RemotingCommand, runtime::RPCHook};
1919

20+
#[allow(async_fn_in_trait)]
2021
pub trait RemotingService: Send {
21-
fn start(&mut self) -> impl std::future::Future<Output = ()> + Send;
22+
async fn start(&mut self);
2223

2324
fn shutdown(&mut self);
2425

rocketmq-remoting/src/server/rocketmq_server.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl RocketmqDefaultServer {
4646
}
4747

4848
impl RemotingService for RocketmqDefaultServer {
49-
fn start(&mut self) -> impl std::future::Future<Output = ()> + Send {
49+
async fn start(&mut self) {
5050
let address = self.broker_server_config.bind_address.as_str();
5151
let port = self.broker_server_config.listen_port;
5252
let listener = block_on(async move {
@@ -70,6 +70,7 @@ impl RemotingService for RocketmqDefaultServer {
7070
processor_table,
7171
Some(notify_conn_disconnect),
7272
)
73+
.await
7374
}
7475

7576
fn shutdown(&mut self) {}

0 commit comments

Comments
 (0)