简体   繁体   中英

Execute subscribe method only once at the time in RxSwift

I have a PublishObject object, which is feed by coming data (approximately 16 times per second). When objects coming so quickly, that can be a situation, when one is still processing, but the new one is ready to use. Is it a way to block executing another processing, when the earlier doesn't end his job?

This is called backpressure, and there are different strategies to handle it.

RxJava has .onBackpressureBuffer() operator, but RxSwift does not support it yet.

Perhaps you can copy Java implementation of it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM