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

Redesign flow.Sink interface #14

Open
andrewhare opened this issue Nov 30, 2020 · 1 comment
Open

Redesign flow.Sink interface #14

andrewhare opened this issue Nov 30, 2020 · 1 comment

Comments

@andrewhare
Copy link
Contributor

Currently, flow.Sink is just an io.WriteCloser which is convenient but not ideal for a lot of use cases because the Close method doesn't accept a context.Context.

Most sinks (GCS and S3Compat come to mind) write their contents when they are closed but we have no way of signaling/canceling these operations.

Do we want to:

  • Make our own interface that accepts a context on close?
  • Redesign the sinks to not write their data on close?
  • Something else I haven't thought of?
@andrewhare andrewhare changed the title Rethink flow.Sink interface Redesign flow.Sink interface Nov 30, 2020
@andrewhare
Copy link
Contributor Author

Another option that occured to me is to store the context that we pass in when we create the sink and use it in the Close method when its called. This doesn't feel like a great solution but it works for now.

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

No branches or pull requests

1 participant