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

fs2StreamToChunkerator has multiple implementation issues #4

Open
sullivan- opened this issue Mar 17, 2017 · 2 comments
Open

fs2StreamToChunkerator has multiple implementation issues #4

sullivan- opened this issue Mar 17, 2017 · 2 comments

Comments

@sullivan-
Copy link
Member

Current implementation limitations:

  • Task effect is hardcoded. We should be able to adapt regardless of the effect type (so long as it's monadic).
  • Uses promises for communication between producer and consumer. Maybe this is okay for, say, and Play converter. But there has to be a more catsy way to do this. Right now, my cat-fu is not strong enough to pull it off. Maybe in the future, I will figure it out. But if you are good with this kind of thing and want to take a stab at it, that would be great.
  • Steals a Future from the global execution context to kick off the producer asynchronously. A more catsy approach, as described in the last bullet point, should do away with this. I didn't want to add an implicit ExecutionContext argument here, as that seems like an implementation detail, and a rewrite of this method without it would not be backwards compatible. Maybe there is some way to pull this off with Task? I tried, couldn't figure it out
@sullivan-
Copy link
Member Author

You might look at fs2.io.JavaInputOutputStream.toInputStream for ideas. I tried to adapt that code, but it was a little too much for me to figure out at the time.

@sullivan-
Copy link
Member Author

I'd like to mention that I myself am only using this adapter in a test suite, so getting a better implementation here may well be a lot more important to you than it is to me. Of course, I want to see this project beautiful and complete. But I have a lot of priorities to balance. If you care, please consider chipping in! Thank you.

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