@@ -89,13 +89,28 @@ public static Scheduler executor(ScheduledExecutorService executor) {
89
89
* <p>
90
90
* This can be used for event-loops, processing callbacks and other computational work.
91
91
* <p>
92
- * Do not perform IO-bound work on this scheduler. Use {@link #threadPoolForComputation ()} instead.
92
+ * Do not perform IO-bound work on this scheduler. Use {@link #io ()} instead.
93
93
*
94
94
* @return {@link ExecutorScheduler} for computation-bound work.
95
+ * @Deprecated Use {@link #computation()}
95
96
*/
97
+ @ Deprecated
96
98
public static Scheduler threadPoolForComputation () {
97
99
return executor (COMPUTATION_EXECUTOR );
98
100
}
101
+
102
+ /**
103
+ * {@link Scheduler} intended for computational work.
104
+ * <p>
105
+ * This can be used for event-loops, processing callbacks and other computational work.
106
+ * <p>
107
+ * Do not perform IO-bound work on this scheduler. Use {@link #io()} instead.
108
+ *
109
+ * @return {@link Scheduler} for computation-bound work.
110
+ */
111
+ public static Scheduler computation () {
112
+ return executor (COMPUTATION_EXECUTOR );
113
+ }
99
114
100
115
/**
101
116
* {@link Scheduler} intended for IO-bound work.
@@ -104,13 +119,30 @@ public static Scheduler threadPoolForComputation() {
104
119
* <p>
105
120
* This can be used for asynchronously performing blocking IO.
106
121
* <p>
107
- * Do not perform computational work on this scheduler. Use {@link #threadPoolForComputation ()} instead.
122
+ * Do not perform computational work on this scheduler. Use {@link #computation ()} instead.
108
123
*
109
124
* @return {@link ExecutorScheduler} for IO-bound work.
125
+ * @deprecated Use {@link #io()} instead.
110
126
*/
127
+ @ Deprecated
111
128
public static Scheduler threadPoolForIO () {
112
129
return executor (IO_EXECUTOR );
113
130
}
131
+
132
+ /**
133
+ * {@link Scheduler} intended for IO-bound work.
134
+ * <p>
135
+ * The implementation is backed by an {@link Executor} thread-pool that will grow as needed.
136
+ * <p>
137
+ * This can be used for asynchronously performing blocking IO.
138
+ * <p>
139
+ * Do not perform computational work on this scheduler. Use {@link #computation()} instead.
140
+ *
141
+ * @return {@link ExecutorScheduler} for IO-bound work.
142
+ */
143
+ public static Scheduler io () {
144
+ return executor (IO_EXECUTOR );
145
+ }
114
146
115
147
private static ScheduledExecutorService createComputationExecutor () {
116
148
int cores = Runtime .getRuntime ().availableProcessors ();
0 commit comments