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

Implementation of endpoint_send_filter #58

Merged
merged 2 commits into from
Jun 15, 2020

Conversation

markmandel
Copy link
Member

This includes passing the FilterChain into the Session, so that is can
call endpoint_send_filter when sending data out through the endpoint.

Work on #1

This includes passing the FilterChain into the Session, so that is can
call endpoint_send_filter when sending data out through the endpoint.

Work on #1
@markmandel markmandel added kind/feature New feature or request area/user-experience Pertaining to developers trying to use Quilkin, e.g. cli interface, configuration, etc labels Jun 8, 2020
@markmandel markmandel requested a review from iffyio June 8, 2020 22:18
Copy link
Collaborator

@iffyio iffyio left a comment

Choose a reason for hiding this comment

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

Looks good! only a minor comment on possibly making send_to return type more explicit

session.send_to(msg.as_bytes()).await.unwrap();
assert_eq!(msg, wait.await.unwrap());

// with a filters
Copy link
Collaborator

Choose a reason for hiding this comment

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

'filters' should be 'filter' ?

return self.send.send_to(data.as_slice(), &self.dest.address).await;
}

Ok(0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we change the return type for this function to e.g Result<Option<size>> or similar enum that would allow the caller to differentiate between a dropped packet and a packet without payload (that could have size 0?)? In the drop case the returned value would be e.g Ok(None) so that we won't have to worry about cases where size 0 might be special.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Strong agree on this one, indeed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Excellent suggestion. Will jump on it 👍

Copy link
Collaborator

@iffyio iffyio left a comment

Choose a reason for hiding this comment

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

LGTM!

@markmandel markmandel merged commit 2043eb8 into master Jun 15, 2020
@markmandel markmandel deleted the feature/endpoint_send_filter branch June 15, 2020 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/user-experience Pertaining to developers trying to use Quilkin, e.g. cli interface, configuration, etc cla: yes kind/feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants