use crate::net::channel::Channel;
use crate::protocol::remoting_command::RemotingCommand;
use crate::runtime::connection_handler_context::ConnectionHandlerContext;
pub type RejectRequestResponse = (bool, Option<RemotingCommand>);
#[trait_variant::make(RequestProcessor: Send )]
pub trait LocalRequestProcessor {
async fn process_request(
&mut self,
channel: Channel,
ctx: ConnectionHandlerContext,
request: &mut RemotingCommand,
) -> rocketmq_error::RocketMQResult<Option<RemotingCommand>>;
fn reject_request(&self, _code: i32) -> RejectRequestResponse {
(false, None)
}
}