-
Notifications
You must be signed in to change notification settings - Fork 1
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
Futures library #8
Comments
OMG thanks much! |
@leonid-s-usov I am guessing by your reaction this would suit your needs? |
Well, it definitely looks like that! I'm reading the sources currently, but I can already see that's a great start for me. |
OK so after briefly reviewing the code I feel like this implementation has mixed the Future and Promise concepts (actually Promise is used only as a wrapper to the observer which will be fulfilled by the actual task) Not sure yet if that's doable in some less laborious way, but since Future class is not ProducerProtocol it doesn't inherit all operators which can be used for signals / producers, meaning a lot of code duplication. Maybe that's the only way to have it done, by copying the interface. So, this is not Promises A+ and will not be, but it's still very nice, I'm happy that I was pointed to this implementation. But looks like this will only heat up a wish to spawn yet another layer library since I feel there's place for improvement :) |
@leonid-s-usov let me know when and if you would like to spin this off, so I can do some prep work. 👍 |
@leonid-s-usov Hello :) We are glad you like it ! Our future implementation is not "cold" but "hot" because as soon as you initialize it by passing a Here is the piece of code I am talking about: public init(signalProducer: SignalProducer<Value, Error>) {
self.futureProducer = signalProducer.take(first: 1).replayLazily(upTo: 1)
self.disposable = self.futureProducer.start()
} Concerning the fact that it is not ProducerProtocol compliant, I think it might be because we were lacking knowledge in Swift and ReactiveSwift. I do not know if it is really doable but would be definitely interesting. |
Hey, thanks for the response. You are right, I have missed that In any case, I have gone for a trip of implementing a number of proof-of-concept APIs. You can check my proposals of Promise and AsyncValue / AsyncValueProducer. |
OMsignal would like to contribute to the community by bringing a small
Futures
library we have developed a few years ago.https://github.com/OMsignal/ReactiveFuturesKit
The text was updated successfully, but these errors were encountered: