Make Mapper accept both Scala Futures and Twitter Futures
We can make a conversion (powered by Bijection) happen automatically in Mapper so users won't be worring about that.
Can I solve this issue? :)
Hey @jparkie! You're absolutelly welcome to work on this. Although, I can't promise we will merged this in before 1.0 (the current milestone is 0.8.5/0.9.0).
That is fine. :) By Bijection, do you mean Twitter's Bijection library?
Yep. This gives us bijections to convert Scala Future to Twitter Future and vise versa.
From what I remember of conversations with adopters who are using both futures heavily (e.g. SoundCloud, Tapad, etc.), it sounded like the consensus was that it's least painful to have clearly defined boundaries between the two—I'm not entirely sure allowing users to mix and match at the level proposed here is desirable.
It's also a bit of a shame to bring on a ~2 MB dependency for the sake of a single set of converters.
Thanks @travisbrown! That makes a lot of sense to me. Do you think it'd be ok to provide it as a part of separate package?
@vkostyukov I don't see any reason not to. If it turns out that it actually does work well for people, it could always be moved into core.
I agree that introducing Bijection just for converting Scala Futures to Twitter Futures is cumbersome with the 2MB size. However, I find it useful to use Scala Futures, so I think porting the specific Bijection for Futures as an implicit import may be nice for the core. Unless, there are very distinct uses for interoperability to require a new Finch package.
I actually have been quite busy, and I don't I can dive into Finch any time soon, so if anyone else wants to solve this issue, please do! :)
Can I grab this one?
@Saheb Thinking about this more, I think I'd agree with Travis on this - we shouldn't appreciate mixing of futures at this level. I've already put a cookbook recipe on how to convert between different type of futures. Although, it think I'd probably agree that this kind of functionality might be part of Finch's subproject or even core. Any thoughts on this?
@vkostyukov - Correct me if I didn't understand you correctly. Implement using simple functions instead of adding a dependency on bijections. I am not sure what you mean when you say subproject, do you mean to have a seperate package for those who need such kind of functionality?
Going back to this. I can see how #637 could help us to distinguish different syntax extensions. For example, import io.finch.syntax._ provides mapper instances for Twitter Futures, while import io.finch.syntax.scala._ wires in Scala's Futures.
That would be nice. How about separating the twitter/scala bijections into a separate artifact? As far as I know it's the most used, judging by the number of complaints on an extra 2MB dependency out there. If it is separate we can add it to Finch core.
@spockz I don't think we actually need a bijection dependency. These type of conversions are quite easy to define by hand.
@vkostyukov, I agree with that they are easy to write by hand. However, if they are available in a tiny package I would use that package instead of manually defining it in all of my separate small libraries.
Fixed in #834.