Skip to content

Commit

Permalink
prepare pelikan-net for publish (#113)
Browse files Browse the repository at this point in the history
Renames the `net` crate to `pelikan-net` to prepare to publish it.
  • Loading branch information
brayniac authored Dec 20, 2023
1 parent 6c08407 commit cd25b53
Show file tree
Hide file tree
Showing 26 changed files with 60 additions and 60 deletions.
36 changes: 18 additions & 18 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion src/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ license = { workspace = true }
boring = { workspace = true }
clocksource = { workspace = true }
metriken = { workspace = true }
net = { path = "../net" }
pelikan-net = { path = "../net" }
ringlog = { workspace = true }
serde = { workspace = true, features = ["derive"] }
2 changes: 1 addition & 1 deletion src/common/src/ssl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

pub use boring::ssl::*;

use net::TlsTcpAcceptor;
use pelikan_net::TlsTcpAcceptor;
use std::io::{Error as IoError, ErrorKind as IoErrorKind};

pub trait TlsConfig {
Expand Down
2 changes: 1 addition & 1 deletion src/core/admin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ entrystore = { path = "../../entrystore" }
libc = { workspace = true }
logger = { path = "../../logger" }
metriken = { workspace = true }
net = { path = "../../net" }
pelikan-net = { path = "../../net" }
parking_lot = { workspace = true }
protocol-admin = { path = "../../protocol/admin" }
protocol-common = { path = "../../protocol/common" }
Expand Down
14 changes: 7 additions & 7 deletions src/core/admin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// Licensed under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0

use ::net::event::{Event, Source};
use ::net::*;
use common::signal::Signal;
use common::ssl::tls_acceptor;
use config::{AdminConfig, TlsConfig};
use crossbeam_channel::Receiver;
use logger::*;
use metriken::*;
use pelikan_net::event::{Event, Source};
use pelikan_net::*;
use protocol_admin::*;
use session::{Buf, ServerSession, Session};
use slab::Slab;
Expand Down Expand Up @@ -143,7 +143,7 @@ pub struct Admin {
backlog: VecDeque<Token>,
http_server: Option<tiny_http::Server>,
/// The actual network listener for the ASCII Admin Endpoint
listener: ::net::Listener,
listener: pelikan_net::Listener,
/// The drain handle for the logger
log_drain: Box<dyn Drain>,
/// The maximum number of events to process per call to poll
Expand All @@ -167,7 +167,7 @@ pub struct Admin {
pub struct AdminBuilder {
backlog: VecDeque<Token>,
http_server: Option<tiny_http::Server>,
listener: ::net::Listener,
listener: pelikan_net::Listener,
nevent: usize,
poll: Poll,
sessions: Slab<ServerSession<AdminRequestParser, AdminResponse, AdminRequest>>,
Expand All @@ -189,15 +189,15 @@ impl AdminBuilder {
let tcp_listener = TcpListener::bind(addr)?;

let mut listener = match (config.use_tls(), tls_acceptor(tls_config)?) {
(true, Some(tls_acceptor)) => ::net::Listener::from((tcp_listener, tls_acceptor)),
_ => ::net::Listener::from(tcp_listener),
(true, Some(tls_acceptor)) => pelikan_net::Listener::from((tcp_listener, tls_acceptor)),
_ => pelikan_net::Listener::from(tcp_listener),
};

let poll = Poll::new()?;
listener.register(poll.registry(), LISTENER_TOKEN, Interest::READABLE)?;

let waker = Arc::new(Waker::from(
::net::Waker::new(poll.registry(), WAKER_TOKEN).unwrap(),
pelikan_net::Waker::new(poll.registry(), WAKER_TOKEN).unwrap(),
));

let nevent = config.nevent();
Expand Down
2 changes: 1 addition & 1 deletion src/core/proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ crossbeam-channel = { workspace = true }
entrystore = { path = "../../entrystore" }
logger = { path = "../../logger" }
metriken = { workspace = true }
net = { path = "../../net" }
pelikan-net = { path = "../../net" }
protocol-admin = { path = "../../protocol/admin" }
protocol-common = { path = "../../protocol/common" }
session = { path = "../../session" }
Expand Down
2 changes: 1 addition & 1 deletion src/core/proxy/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ where
let poll = Poll::new()?;

let waker = Arc::new(Waker::from(
::net::Waker::new(poll.registry(), WAKER_TOKEN).unwrap(),
pelikan_net::Waker::new(poll.registry(), WAKER_TOKEN).unwrap(),
));

let nevent = config.nevent();
Expand Down
2 changes: 1 addition & 1 deletion src/core/proxy/src/frontend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl<FrontendParser, FrontendRequest, FrontendResponse, BackendRequest, BackendR
let poll = Poll::new()?;

let waker = Arc::new(Waker::from(
::net::Waker::new(poll.registry(), WAKER_TOKEN).unwrap(),
pelikan_net::Waker::new(poll.registry(), WAKER_TOKEN).unwrap(),
));

let nevent = config.nevent();
Expand Down
4 changes: 2 additions & 2 deletions src/core/proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ extern crate logger;
#[macro_use]
extern crate metriken;

use ::net::event::{Event, Source};
use ::net::*;
use admin::AdminBuilder;
use common::signal::Signal;
use common::ssl::tls_acceptor;
Expand All @@ -24,6 +22,8 @@ use crossbeam_channel::{bounded, Receiver, Sender};
use entrystore::EntryStore;
use logger::Drain;
use metriken::*;
use pelikan_net::event::{Event, Source};
use pelikan_net::*;
use protocol_common::{Compose, Execute, Parse};
use session::{Buf, ServerSession, Session};
use slab::Slab;
Expand Down
10 changes: 5 additions & 5 deletions src/core/proxy/src/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub static LISTENER_EVENT_WRITE: Counter = Counter::new();
pub static LISTENER_SESSION_DISCARD: Counter = Counter::new();

pub struct ListenerBuilder {
listener: ::net::Listener,
listener: pelikan_net::Listener,
nevent: usize,
poll: Poll,
sessions: Slab<Session>,
Expand All @@ -70,16 +70,16 @@ impl ListenerBuilder {
let tcp_listener = TcpListener::bind(addr)?;

let mut listener = if let Some(tls_acceptor) = tls_acceptor(tls_config)? {
::net::Listener::from((tcp_listener, tls_acceptor))
pelikan_net::Listener::from((tcp_listener, tls_acceptor))
} else {
::net::Listener::from(tcp_listener)
pelikan_net::Listener::from(tcp_listener)
};

let poll = Poll::new()?;
listener.register(poll.registry(), LISTENER_TOKEN, Interest::READABLE)?;

let waker = Arc::new(Waker::from(
::net::Waker::new(poll.registry(), WAKER_TOKEN).unwrap(),
pelikan_net::Waker::new(poll.registry(), WAKER_TOKEN).unwrap(),
));

let nevent = config.nevent();
Expand Down Expand Up @@ -121,7 +121,7 @@ impl ListenerBuilder {

pub struct Listener {
/// The actual network listener server
listener: ::net::Listener,
listener: pelikan_net::Listener,
/// The maximum number of events to process per call to poll
nevent: usize,
/// The actual poll instantance
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ entrystore = { path = "../../entrystore" }
libc = {workspace = true}
logger = { path = "../../logger" }
metriken = { workspace = true }
net = { path = "../../net" }
pelikan-net = { path = "../../net" }
protocol-admin = { path = "../../protocol/admin" }
protocol-common = { path = "../../protocol/common" }
session = { path = "../../session" }
Expand Down
4 changes: 2 additions & 2 deletions src/core/server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@
#[macro_use]
extern crate logger;

use ::net::event::{Event, Source};
use ::net::*;
use admin::AdminBuilder;
use common::signal::Signal;
use common::ssl::tls_acceptor;
Expand All @@ -103,6 +101,8 @@ use crossbeam_channel::{bounded, Sender};
use entrystore::EntryStore;
use logger::{Drain, Klog};
use metriken::*;
use pelikan_net::event::{Event, Source};
use pelikan_net::*;
use protocol_common::{Compose, Execute, Parse};
use session::{Buf, ServerSession, Session};
use slab::Slab;
Expand Down
10 changes: 5 additions & 5 deletions src/core/server/src/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub static LISTENER_SESSION_DISCARD: Counter = Counter::new();

pub struct Listener {
/// The actual network listener server
listener: ::net::Listener,
listener: pelikan_net::Listener,
/// The maximum number of events to process per call to poll
nevent: usize,
/// The actual poll instantance
Expand All @@ -68,7 +68,7 @@ pub struct Listener {
}

pub struct ListenerBuilder {
listener: ::net::Listener,
listener: pelikan_net::Listener,
nevent: usize,
poll: Poll,
sessions: Slab<Session>,
Expand All @@ -89,16 +89,16 @@ impl ListenerBuilder {
let tcp_listener = TcpListener::bind(addr)?;

let mut listener = if let Some(tls_acceptor) = tls_acceptor(tls_config)? {
::net::Listener::from((tcp_listener, tls_acceptor))
pelikan_net::Listener::from((tcp_listener, tls_acceptor))
} else {
::net::Listener::from(tcp_listener)
pelikan_net::Listener::from(tcp_listener)
};

let poll = Poll::new()?;
listener.register(poll.registry(), LISTENER_TOKEN, Interest::READABLE)?;

let waker = Arc::new(Waker::from(
::net::Waker::new(poll.registry(), WAKER_TOKEN).unwrap(),
pelikan_net::Waker::new(poll.registry(), WAKER_TOKEN).unwrap(),
));

let nevent = config.nevent();
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/src/workers/multi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl<Parser, Request, Response> MultiWorkerBuilder<Parser, Request, Response> {
let poll = Poll::new()?;

let waker = Arc::new(Waker::from(
::net::Waker::new(poll.registry(), WAKER_TOKEN).unwrap(),
pelikan_net::Waker::new(poll.registry(), WAKER_TOKEN).unwrap(),
));

let nevent = config.nevent();
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/src/workers/single.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl<Parser, Request, Response, Storage> SingleWorkerBuilder<Parser, Request, Re
let poll = Poll::new()?;

let waker = Arc::new(Waker::from(
::net::Waker::new(poll.registry(), WAKER_TOKEN).unwrap(),
pelikan_net::Waker::new(poll.registry(), WAKER_TOKEN).unwrap(),
));

let nevent = config.nevent();
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/src/workers/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl<Request, Response, Storage> StorageWorkerBuilder<Request, Response, Storage
let poll = Poll::new()?;

let waker = Arc::new(Waker::from(
::net::Waker::new(poll.registry(), WAKER_TOKEN).unwrap(),
pelikan_net::Waker::new(poll.registry(), WAKER_TOKEN).unwrap(),
));

let nevent = config.nevent();
Expand Down
4 changes: 2 additions & 2 deletions src/net/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "net"
description = "Networking abstractions for non-blocking event loops"
name = "pelikan-net"
description = "Pelikan project's networking abstractions for non-blocking event loops"
authors = ["Brian Martin <[email protected]>"]

version = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion src/proxy/momento/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ libc = { workspace = true }
logger = { path = "../../logger" }
metriken = { workspace = true }
momento = "0.32.0"
net = { path = "../../net" }
pelikan-net = { path = "../../net" }
protocol-admin = { path = "../../protocol/admin" }
protocol-memcache = { path = "../../protocol/memcache" }
protocol-resp = { path = "../../protocol/resp" }
Expand Down
2 changes: 1 addition & 1 deletion src/proxy/momento/src/frontend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use crate::protocol::*;
use crate::*;
use net::TCP_SEND_BYTE;
use pelikan_net::TCP_SEND_BYTE;
use session::Buf;

pub(crate) async fn handle_memcache_client(
Expand Down
2 changes: 1 addition & 1 deletion src/proxy/momento/src/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// http://www.apache.org/licenses/LICENSE-2.0

use crate::*;
use ::net::{TCP_ACCEPT, TCP_CLOSE, TCP_CONN_CURR};
use pelikan_net::{TCP_ACCEPT, TCP_CLOSE, TCP_CONN_CURR};

pub(crate) async fn listener(
listener: TcpListener,
Expand Down
2 changes: 1 addition & 1 deletion src/proxy/momento/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use logger::configure_logging;
use logger::Drain;
use metriken::*;
use momento::*;
use net::TCP_RECV_BYTE;
use pelikan_net::TCP_RECV_BYTE;
use protocol_admin::*;
use session::*;
use std::borrow::{Borrow, BorrowMut};
Expand Down
Loading

0 comments on commit cd25b53

Please sign in to comment.