Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions rocketmq-remoting/src/remoting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,79 @@ pub trait InvokeCallback {
fn operation_succeed(&self, response: RemotingCommand);
fn operation_fail(&self, throwable: Box<dyn std::error::Error>);
}

#[allow(unused_variables)]
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The #[allow(unused_variables)] attribute is applied broadly to the entire module. This should be removed once the empty method implementations are completed, as it may hide legitimate unused variable warnings in future development.

Suggested change
#[allow(unused_variables)]

Copilot uses AI. Check for mistakes.
mod inner {
use std::collections::HashMap;
use std::sync::Arc;

use crate::base::response_future::ResponseFuture;
use crate::net::channel::Channel;
use crate::protocol::remoting_command::RemotingCommand;
use crate::protocol::RemotingCommandType;
use crate::remoting_server::server::Shutdown;
use crate::runtime::connection_handler_context::ConnectionHandlerContext;
use crate::runtime::processor::RequestProcessor;
use crate::runtime::RPCHook;

struct RemotingGeneral<RP> {
request_processor: RP,
shutdown: Shutdown,
rpc_hooks: Arc<Vec<Box<dyn RPCHook>>>,
response_table: HashMap<i32, ResponseFuture>,
}

impl<RP> RemotingGeneral<RP>
where
RP: RequestProcessor + Sync + 'static + Clone,
{
pub fn process_message_received(
&mut self,
channel: Channel,
ctx: ConnectionHandlerContext,
cmd: &mut RemotingCommand,
) {
match cmd.get_type() {
RemotingCommandType::REQUEST => {
self.process_request_command(channel, ctx, cmd);
}
RemotingCommandType::RESPONSE => {
self.process_response_command(channel, ctx, cmd);
}
}
}

fn process_request_command(
&mut self,
channel: Channel,
ctx: ConnectionHandlerContext,
cmd: &mut RemotingCommand,
) {
}

fn process_response_command(
&mut self,
channel: Channel,
ctx: ConnectionHandlerContext,
cmd: &mut RemotingCommand,
) {
}

fn do_after_rpc_hooks(
&self,
channel: &Channel,
request: &RemotingCommand,
response: Option<&mut RemotingCommand>,
) -> rocketmq_error::RocketMQResult<()> {
unimplemented!("do_after_rpc_hooks unimplemented")
}

pub fn do_before_rpc_hooks(
&self,
channel: &Channel,
request: Option<&mut RemotingCommand>,
) -> rocketmq_error::RocketMQResult<()> {
unimplemented!("do_before_rpc_hooks unimplemented")
Comment on lines +136 to +144
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both RPC hook methods use unimplemented!() which will panic when called. Consider using todo!() instead to indicate these are placeholder implementations, or implement basic no-op functionality that returns Ok(()) to prevent runtime panics.

Copilot uses AI. Check for mistakes.
}
}
}
Loading