Skip to content

Commit

Permalink
ref: renamed tucana namespace from tucana_internal to tucana
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael-goetz committed Dec 16, 2024
1 parent fdae6c9 commit c3d1540
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 18 deletions.
10 changes: 5 additions & 5 deletions src/client/sagittarius/action_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use async_trait::async_trait;
use log::{error, info};
use tonic::transport::Channel;
use tonic::{Request, Response};
use tucana_internal::aquila::InformationRequest;
use tucana_internal::sagittarius::action_service_client::ActionServiceClient;
use tucana_internal::sagittarius::{ActionLogoffRequest, ActionLogoffResponse, ActionLogonRequest, ActionLogonResponse};
use tucana::aquila::InformationRequest;
use tucana::sagittarius::action_service_client::ActionServiceClient;
use tucana::sagittarius::{ActionLogoffRequest, ActionLogoffResponse, ActionLogonRequest, ActionLogonResponse};

/// Struct representing a service for sending flows received from an `Action` to `Sagittarius`.
/// Part that informs `Sagittarius`
Expand Down Expand Up @@ -83,13 +83,13 @@ impl SagittariusActionClient for SagittariusActionClientBase {
mod tests {
use super::*;
use tonic::{transport::Server, Request, Response, Status};
use tucana_internal::sagittarius::{
use tucana::sagittarius::{
action_service_server::{ActionService, ActionServiceServer},
ActionLogoffRequest, ActionLogoffResponse, ActionLogonRequest, ActionLogonResponse,
};
use std::net::SocketAddr;
use tokio::task::JoinHandle;
use tucana_internal::shared::{RuntimeFunctionDefinition, RuntimeParameterDefinition};
use tucana::shared::{RuntimeFunctionDefinition, RuntimeParameterDefinition};

#[derive(Debug, Default)]
struct MockActionService;
Expand Down
8 changes: 4 additions & 4 deletions src/client/sagittarius/flow_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use std::sync::Arc;
use tokio::sync::Mutex;
use tonic::transport::Channel;
use tonic::Request;
use tucana_internal::sagittarius::flow_service_client::FlowServiceClient;
use tucana_internal::sagittarius::{FlowCommandType, FlowGetRequest, FlowLogonRequest, FlowResponse};
use tucana::sagittarius::flow_service_client::FlowServiceClient;
use tucana::sagittarius::{FlowCommandType, FlowGetRequest, FlowLogonRequest, FlowResponse};

const INSERT: i32 = FlowCommandType::Insert as i32;
const DELETE: i32 = FlowCommandType::Delete as i32;
Expand Down Expand Up @@ -153,8 +153,8 @@ mod tests {
use tonic::codegen::tokio_stream::Stream;
use tonic::transport::Server;
use tonic::{Request, Response, Status};
use tucana_internal::sagittarius::flow_service_server::{FlowService as SagittariusFlowService, FlowServiceServer};
use tucana_internal::sagittarius::{Flow, FlowGetRequest, FlowGetResponse, FlowLogonRequest, FlowResponse};
use tucana::sagittarius::flow_service_server::{FlowService as SagittariusFlowService, FlowServiceServer};
use tucana::sagittarius::{Flow, FlowGetRequest, FlowGetResponse, FlowLogonRequest, FlowResponse};

struct MockFlowService {
flow_get_result: FlowGetResponse,
Expand Down
4 changes: 2 additions & 2 deletions src/configuration/start_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use log::{debug, error, info};
use redis::aio::MultiplexedConnection;
use tokio::sync::Mutex;
use tokio::time::Interval;
use tucana_internal::sagittarius::Flow;
use tucana_internal::sagittarius::flow_service_client::FlowServiceClient;
use tucana::sagittarius::Flow;
use tucana::sagittarius::flow_service_client::FlowServiceClient;
use crate::client::sagittarius::flow_client::{SagittariusFlowClient, SagittariusFlowClientBase};
use crate::configuration::config::Config;
use crate::service::flow_service::{FlowService, FlowServiceBase};
Expand Down
16 changes: 12 additions & 4 deletions src/server/action/action_server.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
use std::sync::Arc;
use async_trait::async_trait;
use tokio::sync::Mutex;
use tonic::{Response, Status, Streaming};
use tucana_internal::aquila::action_transfer_service_server::ActionTransferService;
use tucana_internal::aquila::{InformationRequest, InformationResponse};
use tonic::{Request, Response, Status, Streaming};
use tucana::aquila::action_transfer_service_server::ActionTransferService;
use tucana::aquila::{ActionExecuteRequest, InformationRequest, InformationResponse};
use crate::service::action_service::{ActionService, ActionServiceBase};

pub struct ActionTransferServerBase {
action_service: Arc<Mutex<ActionServiceBase>>,
}

pub type ExecuteStream = ();

/// gRPC Service Implementation
#[async_trait]
impl ActionTransferService for ActionTransferServerBase {
/// Transfers `Flows` redivided from the `Action` to `Sagittarius`
async fn transfer(&self, request: tonic::Request<Streaming<InformationRequest>>) -> Result<Response<InformationResponse>, Status> {
async fn transfer(&self, request: Request<Streaming<InformationRequest>>) -> Result<Response<InformationResponse>, Status> {
let mut service = self.action_service.lock().await;
service.transfer_action_flows(request).await
}

type ExecuteStream = ();

async fn execute(&self, request: Request<Streaming<ActionExecuteRequest>>) -> Result<Response<Self::ExecuteStream>, Status> {
todo!()
}
}
2 changes: 1 addition & 1 deletion src/service/action_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use futures::StreamExt;
use log::error;
use tokio::sync::Mutex;
use tonic::{Request, Response, Status, Streaming};
use tucana_internal::aquila::{InformationRequest, InformationResponse};
use tucana::aquila::{InformationRequest, InformationResponse};
use crate::client::sagittarius::action_client::{SagittariusActionClient, SagittariusActionClientBase};

/// Struct representing a service for sending flows received from an `Action` to `Sagittarius`.
Expand Down
4 changes: 2 additions & 2 deletions src/service/flow_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use redis::aio::MultiplexedConnection;
use redis::{AsyncCommands, RedisError};
use std::sync::Arc;
use tokio::sync::Mutex;
use tucana_internal::sagittarius::Flow;
use tucana::sagittarius::Flow;

/// Struct representing a service for managing flows in a Redis.
pub struct FlowServiceBase {
Expand Down Expand Up @@ -144,7 +144,7 @@ mod tests {
use std::sync::{Arc};
use redis::AsyncCommands;
use tokio::sync::Mutex;
use tucana_internal::sagittarius::Flow;
use tucana::sagittarius::Flow;
use crate::data::redis::setup_redis_test_container;
use crate::service::flow_service::{FlowService, FlowServiceBase};

Expand Down

0 comments on commit c3d1540

Please sign in to comment.