-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Substitution for SignalProducer.buffer() #3070
Comments
|
@andersio oh, thanks a lot, I thought not about right properties |
Hy, What if I wanted to send back an error to the buffered SignalProducer? Regards |
If you really need the old Note that
|
Thanks, It's what I was looking for |
Thanks, |
replayLazily seems has side effect. take a look at example below
I didn't read the code of replayLazily, but it seems used a cached value instead of using observer sent value. Problem is when observer send value, the failure procedure is called instead of success. To solve this problem I have to create a Signal every time I call someProcedure, don't think it's a good practice... any comment is welcome |
When the second time you call The replayed producer cached this error for you, and this is why you get "Line 1" called before "Line 2" - it replayed the error. Please note that sending an error means termination of the event stream. |
@andersio Thanks for replying. I guess since the producer is terminated, it's OK to create a new signal to handle the async procedure like this
I guess what I want is Future semantics here... I've read #2744 and noticed
But as benji-bou said, Property does not emit errors. It seems I have to use two Property to handle error, one is Success Property, wrapping the value I want, the other is an Error Property, and I have to observe on both of them, right? |
It seems what you want is wrapping a delegate pattern as streams of values, while the delegate is triggered as a result of starting the producer. In this case, I think you'd be better off with an internal
|
@andersio Thanks for your patience, problem solved 👍 |
Deprecation warning says nothing to me - Use properties instead. 'buffer' will be removed in RAC 5.0
What properties? Could someone provide clear example. Thanks.
The text was updated successfully, but these errors were encountered: