163 |
|
/** Run status, updated only within locks */ |
164 |
|
volatile boolean closed; |
165 |
|
/** If non-null, the exception in closeExceptionally */ |
166 |
< |
Throwable closeException; |
166 |
> |
volatile Throwable closedException; |
167 |
|
|
168 |
|
// Parameters for constructing BufferedSubscriptions |
169 |
|
final Executor executor; |
261 |
|
if (b == null) { |
262 |
|
Throwable ex; |
263 |
|
subscription.onSubscribe(); |
264 |
< |
if ((ex = closeException) != null) |
264 |
> |
if ((ex = closedException) != null) |
265 |
|
subscription.onError(ex); |
266 |
|
else if (closed) |
267 |
|
subscription.onComplete(); |
558 |
|
b = clients; |
559 |
|
clients = null; |
560 |
|
closed = true; |
561 |
< |
closeException = error; |
561 |
> |
closedException = error; |
562 |
|
} |
563 |
|
while (b != null) { |
564 |
|
BufferedSubscription<T> next = b.next; |
578 |
|
return closed; |
579 |
|
} |
580 |
|
|
581 |
+ |
|
582 |
+ |
/** |
583 |
+ |
* Returns the exception associated with {@link #closeExceptionally}, |
584 |
+ |
* or null if not closed or if closed normally. |
585 |
+ |
* |
586 |
+ |
* @return the exception, or null if none |
587 |
+ |
*/ |
588 |
+ |
public Throwable getClosedException() { |
589 |
+ |
return closedException; |
590 |
+ |
} |
591 |
+ |
|
592 |
|
/** |
593 |
|
* Returns true if this publisher has any subscribers. |
594 |
|
* |