You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/io/reactivex/rxjava3/plugins/RxJavaPlugins.java
+21-1
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@
15
15
16
16
importjava.lang.Thread.UncaughtExceptionHandler;
17
17
importjava.util.Objects;
18
-
importjava.util.concurrent.ThreadFactory;
18
+
importjava.util.concurrent.*;
19
19
20
20
importorg.reactivestreams.Subscriber;
21
21
@@ -1302,6 +1302,26 @@ public static Scheduler createSingleScheduler(@NonNull ThreadFactory threadFacto
1302
1302
returnnewSingleScheduler(Objects.requireNonNull(threadFactory, "threadFactory is null"));
1303
1303
}
1304
1304
1305
+
/**
1306
+
* Create an instance of a {@link Scheduler} by wrapping an existing {@link Executor}.
1307
+
* <p>
1308
+
* This method allows creating an {@code Executor}-backed {@code Scheduler} before the {@link Schedulers} class
1309
+
* would initialize the standard {@code Scheduler}s.
1310
+
*
1311
+
* @param executor the {@code Executor} to wrap and turn into a {@code Scheduler}.
1312
+
* @param interruptibleWorker if {@code true}, the tasks submitted to the {@link io.reactivex.rxjava3.core.Scheduler.Worker Scheduler.Worker} will
1313
+
* be interrupted when the task is disposed.
1314
+
* @param fair if {@code true}, tasks submitted to the {@code Scheduler} or {@code Worker} will be executed by the underlying {@code Executor} one after the other, still
1315
+
* in a FIFO and non-overlapping manner, but allows interleaving with other tasks submitted to the underlying {@code Executor}.
1316
+
* If {@code false}, the underlying FIFO scheme will execute as many tasks as it can before giving up the underlying {@code Executor} thread.
1317
+
* @return the new {@code Scheduler} wrapping the {@code Executor}
0 commit comments