Open SAGARSURI opened 5 years ago
Hi @Diolor
I am using the RxJava2 adapter. I saw one issue here. When I do subscribeOn(Schedulers.io()). It will use new thread every single picture I take. This can slow the app in some point of time. Here is my code:
RxJava2
subscribeOn(Schedulers.io())
fotoapparat .autoFocus() .takePicture() .toBitmap() .toSingle() .map { Timber.e(Thread.currentThread().name) it.bitmap.rotate(-it.rotationDegrees.toFloat()) } .subscribeOn(Schedulers.computation()) .observeOn(AndroidSchedulers.mainThread()) .doOnSuccess { MediaActionSound().play(MediaActionSound.SHUTTER_CLICK) } .subscribe({ Timber.e("Image Clicked") userImage = it previewCapturedImage(it) }, { Timber.e(it.message) })
If you see the logcat. You will find this:
RxComputationThreadPool-1 RxComputationThreadPool-2 RxComputationThreadPool-3
How can I use a single computation thread or limit the creation of new thread every time? I am using the latest release i.e 2.7.0
2.7.0
Hi @Diolor
I am using the
RxJava2
adapter. I saw one issue here. When I dosubscribeOn(Schedulers.io())
. It will use new thread every single picture I take. This can slow the app in some point of time. Here is my code:If you see the logcat. You will find this:
How can I use a single computation thread or limit the creation of new thread every time? I am using the latest release i.e
2.7.0