Skip to content

Commit

Permalink
feat: harpc-service -> harpc-system
Browse files Browse the repository at this point in the history
  • Loading branch information
indietyp committed Nov 7, 2024
1 parent 84bb519 commit 1a39f93
Show file tree
Hide file tree
Showing 26 changed files with 34 additions and 34 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ members = [
"libs/@local/harpc/codec",
"libs/@local/harpc/net",
"libs/@local/harpc/server",
"libs/@local/harpc/service",
"libs/@local/harpc/system",
"libs/@local/harpc/tower",
"libs/@local/harpc/types",
"libs/@local/harpc/wire-protocol",
Expand Down Expand Up @@ -61,7 +61,7 @@ harpc-net.path = "libs/@local/harpc/net"
harpc-types.path = "libs/@local/harpc/types"
harpc-wire-protocol.path = "libs/@local/harpc/wire-protocol"
harpc-tower.path = "libs/@local/harpc/tower"
harpc-service.path = "libs/@local/harpc/service"
harpc-system.path = "libs/@local/harpc/system"
harpc-codec.path = "libs/@local/harpc/codec"
harpc-server.path = "libs/@local/harpc/server"
harpc-client.path = "libs/@local/harpc/client"
Expand Down
2 changes: 1 addition & 1 deletion apps/hash-graph/libs/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ error-stack = { workspace = true, features = ["futures", "spantrace", "unstable"
# Private workspace dependencies
graph-type-defs = { workspace = true }
harpc-codec = { workspace = true }
harpc-service = { workspace = true }
harpc-system = { workspace = true }
harpc-tower = { workspace = true }
harpc-types = { workspace = true }
hash-status = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion apps/hash-graph/libs/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@rust/harpc-client": "0.0.0-private",
"@rust/harpc-codec": "0.0.0-private",
"@rust/harpc-server": "0.0.0-private",
"@rust/harpc-service": "0.0.0-private",
"@rust/harpc-system": "0.0.0-private",
"@rust/harpc-tower": "0.0.0-private",
"@rust/harpc-types": "0.0.0-private",
"@rust/hash-graph-store": "0.0.0-private",
Expand Down
4 changes: 2 additions & 2 deletions apps/hash-graph/libs/api/src/rpc/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use harpc_server::{
session::Session,
utils::{delegate_call_discrete, parse_procedure_id},
};
use harpc_service::{delegate::SubsystemDelegate, role::Role};
use harpc_system::{delegate::SubsystemDelegate, role::Role};
use harpc_tower::{body::Body, either::Either, request::Request, response::Response};
use harpc_types::{error_code::ErrorCode, response_kind::ResponseKind};
use hash_graph_store::account::{
Expand Down Expand Up @@ -98,7 +98,7 @@ pub mod meta {
//! In the future this will be automatically generated by the `harpc` crate.
use frunk::HList;
use harpc_service::{
use harpc_system::{
Subsystem,
procedure::{Procedure, ProcedureIdentifier},
};
Expand Down
4 changes: 2 additions & 2 deletions apps/hash-graph/libs/api/src/rpc/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use harpc_server::{
session::Session,
utils::{delegate_call_discrete, parse_procedure_id},
};
use harpc_service::delegate::SubsystemDelegate;
use harpc_system::delegate::SubsystemDelegate;
use harpc_tower::{body::Body, request::Request, response::Response};
use harpc_types::response_kind::ResponseKind;

Expand All @@ -36,7 +36,7 @@ pub mod meta {
//! In the future this will be automatically generated by the `harpc` crate.
use frunk::HList;
use harpc_service::{
use harpc_system::{
Subsystem,
procedure::{Procedure, ProcedureIdentifier},
};
Expand Down
4 changes: 2 additions & 2 deletions apps/hash-graph/libs/api/src/rpc/echo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use harpc_server::{
session::Session,
utils::{delegate_call_discrete, parse_procedure_id},
};
use harpc_service::{delegate::SubsystemDelegate, role::Role};
use harpc_system::{delegate::SubsystemDelegate, role::Role};
use harpc_tower::{body::Body, request::Request, response::Response};
use harpc_types::response_kind::ResponseKind;

Expand All @@ -33,7 +33,7 @@ pub mod meta {
//! In the future this will be automatically generated by the `harpc` crate.
use frunk::HList;
use harpc_service::{
use harpc_system::{
Subsystem,
procedure::{Procedure, ProcedureIdentifier},
};
Expand Down
8 changes: 4 additions & 4 deletions apps/hash-graph/libs/api/src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ pub mod auth;
pub mod echo;
mod session;

use harpc_service::SubsystemIdentifier;
use harpc_system::SubsystemIdentifier;
use harpc_types::subsystem::SubsystemId;

mod role {
use harpc_client::connection::Connection;
use harpc_server::session::Session;
pub(crate) use harpc_service::role::Role;
pub(crate) use harpc_system::role::Role;

use super::session::Account;

pub(crate) type Server = harpc_service::role::Server<Session<Account>>;
pub(crate) type Client<Svc, C> = harpc_service::role::Client<Connection<Svc, C>>;
pub(crate) type Server = harpc_system::role::Server<Session<Account>>;
pub(crate) type Client<Svc, C> = harpc_system::role::Client<Connection<Svc, C>>;
}

#[derive(Debug, Copy, Clone)]
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/harpc/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ publish.workspace = true
[dependencies]
# Public workspace dependencies
harpc-tower = { workspace = true, public = true }
harpc-service = { workspace = true, public = true }
harpc-system = { workspace = true, public = true }

# Public third-party dependencies
tower = { workspace = true, public = true }
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/harpc/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@rust/error-stack": "0.5.0",
"@rust/harpc-codec": "0.0.0-private",
"@rust/harpc-net": "0.0.0-private",
"@rust/harpc-service": "0.0.0-private",
"@rust/harpc-system": "0.0.0-private",
"@rust/harpc-tower": "0.0.0-private",
"@rust/harpc-types": "0.0.0-private"
}
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/harpc/client/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use error_stack::{Report, ResultExt as _, TryReportStreamExt as _};
use futures::{StreamExt as _, stream};
use harpc_codec::encode::Encoder;
use harpc_net::session::server::SessionId;
use harpc_service::{Subsystem, procedure::ProcedureIdentifier};
use harpc_system::{Subsystem, procedure::ProcedureIdentifier};
use harpc_tower::{
Extensions,
request::{self, Request},
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/harpc/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ publish.workspace = true

[dependencies]
# Public workspace dependencies
harpc-service = { workspace = true, public = true }
harpc-system = { workspace = true, public = true }
harpc-net = { workspace = true, public = true }

# Public third-party dependencies
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/harpc/server/examples/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use graph_types::account::AccountId;
use harpc_client::{Client, ClientConfig, connection::Connection};
use harpc_codec::{decode::Decoder, encode::Encoder, json::JsonCodec};
use harpc_server::{Server, ServerConfig, router::RouterBuilder, serve::serve, session::SessionId};
use harpc_service::{
use harpc_system::{
Subsystem, SubsystemIdentifier,
delegate::SubsystemDelegate,
procedure::{Procedure, ProcedureIdentifier},
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/harpc/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@rust/error-stack": "0.5.0",
"@rust/harpc-codec": "0.0.0-private",
"@rust/harpc-net": "0.0.0-private",
"@rust/harpc-service": "0.0.0-private",
"@rust/harpc-system": "0.0.0-private",
"@rust/harpc-tower": "0.0.0-private",
"@rust/harpc-types": "0.0.0-private"
},
Expand Down
8 changes: 4 additions & 4 deletions libs/@local/harpc/server/src/delegate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ use core::{
task::{Context, Poll},
};

use harpc_service::delegate::SubsystemDelegate;
use harpc_system::delegate::SubsystemDelegate;
use harpc_tower::{body::Body, request::Request, response::Response};
use tower::Service;

use crate::session::{RequestInfo, Session, SessionStorage};

/// Bridge between `harpc-service` and `tower`.
/// Bridge between `harpc-system` and `tower`.
///
/// This is a very thin layer between the `harpc-service` and `tower` services. It is responsible
/// This is a very thin layer between the `harpc-system` and `tower` systems. It is responsible
/// for taking the incoming request, selecting the appropriate session and codec, and then
/// delegating the request to the inner service (which is cloned).
/// delegating the request to the inner system (which is cloned).
///
/// A conscious decision was made not to have `ServiceDelegate` be a `Service`, as it allows for
/// greater ergonomics, and allows server implementation that are not based on tower in the future.
Expand Down
4 changes: 2 additions & 2 deletions libs/@local/harpc/server/src/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use bytes::Bytes;
use frunk::{HCons, HNil};
use futures::FutureExt as _;
use harpc_codec::error::NetworkError;
use harpc_service::{RefinedSubsystemIdentifier, SubsystemIdentifier};
use harpc_system::{RefinedSubsystemIdentifier, SubsystemIdentifier};
use harpc_tower::{
body::{Body, controlled::Controlled, full::Full},
request::Request,
Expand All @@ -26,7 +26,7 @@ pub struct Handler<S, I> {
impl<Svc> Handler<Svc, !> {
pub(crate) const fn new<Sys>(inner: Svc) -> Handler<Svc, Sys::SubsystemId>
where
Sys: harpc_service::Subsystem,
Sys: harpc_system::Subsystem,
{
Handler {
subsystem: Sys::ID,
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/harpc/server/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use core::{
use frunk::{HCons, HNil};
use futures::{FutureExt as _, Stream};
use harpc_net::session::server::SessionEvent;
use harpc_service::{Subsystem, delegate::SubsystemDelegate};
use harpc_system::{Subsystem, delegate::SubsystemDelegate};
use harpc_tower::{
body::Body,
net::pack::{PackLayer, PackService},
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/harpc/server/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use core::{array, pin::pin};
use error_stack::{Report, ResultExt as _};
use futures::{StreamExt as _, stream};
use harpc_codec::{decode::ReportDecoder, encode::Encoder};
use harpc_service::{Subsystem, procedure::ProcedureIdentifier};
use harpc_system::{Subsystem, procedure::ProcedureIdentifier};
use harpc_tower::{
body::{Body, BodyExt as _, Frame, controlled::Controlled, stream::StreamBody},
request::Request,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cargo-features = ["edition2024"]

[package]
name = "harpc-service"
name = "harpc-system"
authors.workspace = true
version.workspace = true
edition.workspace = true
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@rust/harpc-service",
"name": "@rust/harpc-system",
"version": "0.0.0-private",
"private": true,
"license": "AGPL-3",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1a39f93

Please sign in to comment.