How To Release Memory Of The Responsetext In An Endless Streaming Request?
I need to use xmlHTTPRequest to fetch data from an endless motion JPEG data stream, and I heard that a nice trick that the responseText can populate data without finishing the requ
Solution 1:
This seems a tough one, I actually solved it.
The answer has nothing to do with my code above, but the code calls this request observable.
I should use repeatWhen
instead of IntervalObservable
. Since IntervalObservable
doesn't care if the request actually complete or not, it will cause request triggered before last one complete. Whereas repeatWhen
ensures the last observable actually complete before the next start.
Please check this enlighten discussion, https://github.com/ReactiveX/RxJava/issues/448
Post a Comment for "How To Release Memory Of The Responsetext In An Endless Streaming Request?"