@@ -49,7 +49,7 @@ public abstract class SyncSubscriber<T> implements Subscriber<T> {
49
49
50
50
if (!done ) { // If we aren't already done
51
51
try {
52
- if (foreach (element )) {
52
+ if (whenNext (element )) {
53
53
try {
54
54
subscription .request (1 ); // Our Subscriber is unbuffered and modest, it requests one element at a time
55
55
} catch (final Throwable t ) {
@@ -76,7 +76,7 @@ public abstract class SyncSubscriber<T> implements Subscriber<T> {
76
76
// herefor we also need to cancel our `Subscription`.
77
77
private void done () {
78
78
//On this line we could add a guard against `!done`, but since rule 3.7 says that `Subscription.cancel()` is idempotent, we don't need to.
79
- done = true ; // If we `foreach ` throws an exception, let's consider ourselves done (not accepting more elements)
79
+ done = true ; // If we `whenNext ` throws an exception, let's consider ourselves done (not accepting more elements)
80
80
try {
81
81
subscription .cancel (); // Cancel the subscription
82
82
} catch (final Throwable t ) {
@@ -87,7 +87,7 @@ private void done() {
87
87
88
88
// This method is left as an exercise to the reader/extension point
89
89
// Returns whether more elements are desired or not, and if no more elements are desired
90
- protected abstract boolean foreach (final T element );
90
+ protected abstract boolean whenNext (final T element );
91
91
92
92
@ Override public void onError (final Throwable t ) {
93
93
if (subscription == null ) { // Technically this check is not needed, since we are expecting Publishers to conform to the spec
0 commit comments