equal
deleted
inserted
replaced
171 * |
171 * |
172 * @param action the action to remove, not {@code null} |
172 * @param action the action to remove, not {@code null} |
173 * |
173 * |
174 * @return {@code true} if the action was removed, {@code false} otherwise |
174 * @return {@code true} if the action was removed, {@code false} otherwise |
175 * |
175 * |
176 * @see #onClose(Runnable) |
|
177 * @see #onFlush(Runnable) |
|
178 * @see #onEvent(Consumer) |
176 * @see #onEvent(Consumer) |
179 * @see #onEvent(String, Consumer) |
177 * @see #onEvent(String, Consumer) |
|
178 * @see #onFlush(Runnable) |
|
179 * @see #onClose(Runnable) |
|
180 * @see #onError(Consumer) |
180 */ |
181 */ |
181 boolean remove(Object action); |
182 boolean remove(Object action); |
182 |
183 |
183 /** |
184 /** |
184 * Specifies that the event object in an {@link #onEvent(Consumer)} action |
185 * Specifies that the event object in an {@link #onEvent(Consumer)} action |
250 * Blocks the current thread until the stream is finished, closed, or it |
251 * Blocks the current thread until the stream is finished, closed, or it |
251 * times out. |
252 * times out. |
252 * |
253 * |
253 * @param timeout the maximum time to wait, not {@code null} |
254 * @param timeout the maximum time to wait, not {@code null} |
254 * |
255 * |
|
256 * @throws IllegalArgumentException if timeout is negative |
|
257 * @throws InterruptedException |
|
258 * |
255 * @see #start() |
259 * @see #start() |
256 * @see #startAsync() |
260 * @see #startAsync() |
257 */ |
261 */ |
258 void awaitTermination(Duration timeout); |
262 void awaitTermination(Duration timeout) throws InterruptedException; |
259 |
263 |
260 /** |
264 /** |
261 * Blocks the current thread until the stream is finished or closed. |
265 * Blocks the current thread until the stream is finished or closed. |
|
266 * |
|
267 * @throws InterruptedException |
262 * |
268 * |
263 * @see #start() |
269 * @see #start() |
264 * @see #startAsync() |
270 * @see #startAsync() |
265 */ |
271 */ |
266 void awaitTermination(); |
272 void awaitTermination() throws InterruptedException; |
267 } |
273 } |