Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: refactor MakeTransport and Incoming #421

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Millione
Copy link
Member

in favour of shmipc

pub trait ShmExt: Send + Sync {
fn release_read_and_reuse(&self) {}

async fn close(&mut self) -> Result<(), anyhow::Error> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use async-trait and anyhow, RPITIT and Box<dyn std::error::Error> will also work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

async-trait is for the Box<dyn ShmExt> usage, anyhow I think it is good enough?

@@ -46,10 +49,14 @@ impl From<TcpListener> for DefaultIncoming {
}

pub trait Incoming: fmt::Debug + Send + 'static {
fn accept(&mut self) -> impl Future<Output = io::Result<Option<Conn>>> + Send;
type Conn: ConnExt;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This naming is very confusing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It represents a connection instance, any good advice about the naming?

pub trait TransportEndpoint {
fn get_transport(&self) -> Option<Transport>;
fn has_transport(&self) -> bool;
fn set_transport(&mut self, transport: Transport);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This trait is also confusing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for log and metrics usage to differ between uds and shmipc

volo/src/context.rs Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants