rstudio / promises

A promise library for R
https://rstudio.github.io/promises
Other
198 stars 19 forks source link

Discuss similarities with delayed package #8

Closed jeremyrcoyle closed 6 years ago

jeremyrcoyle commented 6 years ago

I've been working on a similar package here: https://github.com/jeremyrcoyle/delayed and just now discovered promises. After testing it out a bit, it seems like it might work for the same purposes for which I wrote delayed. I wanted to get in touch with you to discuss the similarities between our projects and try to avoid duplicating effort. What's the best way to contact you for a more in-depth discussion?

jcheng5 commented 6 years ago

Unless you think we need a video chat discussion, this issue would work, or a thread in our Shiny Discourse topic.

The emphasis for the promises package is to never block. Yours seems more like future, in that work can be done in parallel but ultimately you block while waiting for the results. If you're purely concerned about duplication of effort between your future-coordinating functions and my promise-coordinating functions, I wouldn't worry too much about that; that's such a small part of promises and such a large part of your package that I don't think the overlap in functionality matters.

What would be more interesting to me is allowing a delayed object to be converted to a promise. This would allow your delayed stuff to be used in conjunction with Shiny's upcoming async features. (If that's not an interesting goal for you, then feel free to ignore the suggestion.) Here's the corresponding code for future; I imagine it'd look much the same for delayed.

jeremyrcoyle commented 6 years ago

Thanks for clarifying some differences in emphasis between our two packages. I do think that the key problem solved by delayed (the ability to easily parallelize interdependent tasks), seems equally solvable with promises. I'm also sure that I don't have the resources to maintain delayed in the way that development efforts by the RStudio team are maintained, and therefore if promises subsumes the functionality of delayed, i'd rather use promises. For the time being, i'll keep using delayed for what I wrote it for, and I'll keep an eye on promises as it progresses.

To the extent that I continue to use/develop delayed, I do think it would be interesting to add support for converting delayed objects into promises. I'll add an issue to my repo to that effect and get to it when time permits.