mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
Use unbounded thread pool for Rx I/O scheduler.
This commit is contained in:
committed by
Alex Hart
parent
323697dfc9
commit
2dacb3b20f
@@ -354,7 +354,7 @@ public class ApplicationContext extends Application implements AppForegroundObse
|
||||
|
||||
private void initializeRx() {
|
||||
RxDogTag.install();
|
||||
RxJavaPlugins.setInitIoSchedulerHandler(schedulerSupplier -> Schedulers.from(SignalExecutors.BOUNDED_IO, true, false));
|
||||
RxJavaPlugins.setInitIoSchedulerHandler(schedulerSupplier -> Schedulers.from(SignalExecutors.UNBOUNDED, true, false));
|
||||
RxJavaPlugins.setInitComputationSchedulerHandler(schedulerSupplier -> Schedulers.from(SignalExecutors.BOUNDED, true, false));
|
||||
RxJavaPlugins.setErrorHandler(e -> {
|
||||
boolean wasWrapped = false;
|
||||
|
||||
@@ -10,7 +10,6 @@ import org.signal.core.util.ThreadUtil;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.SynchronousQueue;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -52,7 +51,7 @@ public final class SignalExecutors {
|
||||
maxThreads,
|
||||
timeoutSeconds,
|
||||
TimeUnit.SECONDS,
|
||||
new SynchronousQueue<>() {
|
||||
new LinkedBlockingQueue<>() {
|
||||
@Override
|
||||
public boolean offer(Runnable runnable) {
|
||||
if (isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user