finch icon indicating copy to clipboard operation
finch copied to clipboard

Make Mapper accept both Scala Futures and Twitter Futures

Open vkostyukov opened this issue 11 years ago • 17 comments

We can make a conversion (powered by Bijection) happen automatically in Mapper so users won't be worring about that.

vkostyukov avatar Oct 23 '15 21:10 vkostyukov

Can I solve this issue? :)

jparkie avatar Oct 28 '15 13:10 jparkie

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).

vkostyukov avatar Oct 28 '15 16:10 vkostyukov

That is fine. :) By Bijection, do you mean Twitter's Bijection library?

jparkie avatar Oct 28 '15 16:10 jparkie

Yep. This gives us bijections to convert Scala Future to Twitter Future and vise versa.

vkostyukov avatar Oct 28 '15 16:10 vkostyukov

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.

travisbrown avatar Oct 28 '15 16:10 travisbrown

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 avatar Oct 28 '15 16:10 vkostyukov

@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.

travisbrown avatar Oct 28 '15 17:10 travisbrown

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.

jparkie avatar Oct 29 '15 14:10 jparkie

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! :)

jparkie avatar Dec 17 '15 05:12 jparkie

Can I grab this one?

Saheb avatar Jan 21 '16 18:01 Saheb

@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 avatar Jan 22 '16 21:01 vkostyukov

@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?

Saheb avatar Jan 23 '16 15:01 Saheb

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.

vkostyukov avatar Jan 14 '17 22:01 vkostyukov

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 avatar Jan 15 '17 07:01 spockz

@spockz I don't think we actually need a bijection dependency. These type of conversions are quite easy to define by hand.

vkostyukov avatar Jan 19 '17 21:01 vkostyukov

@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.

spockz avatar Jan 20 '17 00:01 spockz

Fixed in #834.

vkostyukov avatar Oct 02 '17 20:10 vkostyukov