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

Context support #19

Open
c4milo opened this issue Dec 18, 2018 · 4 comments
Open

Context support #19

c4milo opened this issue Dec 18, 2018 · 4 comments

Comments

@c4milo
Copy link

c4milo commented Dec 18, 2018

Adding context support would be nice for tracing and cancellation.

Thanks for this library!

@emersion
Copy link
Owner

I'd like to see how the API could look like.

@foxcpp
Copy link
Collaborator

foxcpp commented Jul 17, 2020

For client it would involve duplicating Mail, Rcpt, etc. to add context.Context argument (MailContext, RcptContext).

As for relation to timeouts, perhaps we could have context-less functions create such context with some timeout value (e.g. 5 mins)? That would be convenient for me since maddy interfaces already have context.Context all over the place :)

@foxcpp
Copy link
Collaborator

foxcpp commented Jul 17, 2020

On a second thought, gluing together net.Conn and context.Context is a tricky task so it is probably better to just implement command timeouts like it is done for the server.

@kayrus
Copy link
Contributor

kayrus commented Sep 5, 2020

+1 for the context, especially when you need to print debug logs per request and log the request ID. This would also require a rewriting of the Debug functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants