Impl instantiate in server.rs
This commit is contained in:
parent
cb8c4c828f
commit
054e77d693
1 changed files with 17 additions and 2 deletions
|
@ -1,11 +1,26 @@
|
|||
use quartz_proto::quartz::{core_server::Core, SessionCreateRequest, SessionCreateResponse};
|
||||
use quartz_proto::quartz::{
|
||||
core_server::Core, InstantiateRequest, InstantiateResponse, SessionCreateRequest,
|
||||
SessionCreateResponse,
|
||||
};
|
||||
use tonic::{Request, Response, Status};
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub struct CoreService {}
|
||||
pub struct CoreService;
|
||||
|
||||
#[tonic::async_trait]
|
||||
impl Core for CoreService {
|
||||
async fn instantiate(
|
||||
&self,
|
||||
request: Request<InstantiateRequest>,
|
||||
) -> Result<Response<InstantiateResponse>, Status> {
|
||||
println!("Got a request: {:?}", request);
|
||||
|
||||
let reply = InstantiateResponse {
|
||||
message: "Hello!".to_string(),
|
||||
};
|
||||
|
||||
Ok(Response::new(reply))
|
||||
}
|
||||
async fn session_create(
|
||||
&self,
|
||||
request: Request<SessionCreateRequest>,
|
||||
|
|
Loading…
Reference in a new issue