rocketmq_remoting/
remoting_server.rs

1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18use crate::remoting::RemotingService;
19
20pub mod server;
21
22pub trait RemotingServer: RemotingService {
23    /*fn register_processor(
24        &mut self,
25        request_code: impl Into<i32>,
26        processor: Arc<dyn RequestProcessor + Send + Sync + 'static>,
27    );
28
29    fn register_default_processor(
30        &mut self,
31        processor: impl RequestProcessor + Send + Sync + 'static,
32    );
33    fn local_listen_port(&mut self) -> i32;
34    fn get_processor_pair(
35        &mut self,
36        request_code: i32,
37    ) -> (Arc<dyn RequestProcessor>, Arc<TokioExecutorService>);
38    fn get_default_processor_pair(
39        &mut self,
40    ) -> (Arc<dyn RequestProcessor>, Arc<TokioExecutorService>);
41    //fn new_remoting_server(&self, port: i32) -> Box<dyn RemotingServer>;
42    fn remove_remoting_server(&mut self, port: i32);
43    fn invoke_sync(
44        &mut self,
45        request: RemotingCommand,
46        timeout_millis: u64,
47    ) -> Result<RemotingCommand, Box<dyn std::error::Error>>;
48    fn invoke_async(
49        &mut self,
50        request: RemotingCommand,
51        timeout_millis: u64,
52        invoke_callback: Box<dyn InvokeCallback>,
53    ) -> Result<(), Box<dyn std::error::Error>>;
54    fn invoke_oneway(
55        &mut self,
56        request: RemotingCommand,
57        timeout_millis: u64,
58    ) -> Result<(), Box<dyn std::error::Error>>;*/
59}