Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any).
183539
function () {
        var i, len;
        checkDisposed(this);
        if (!this.isStopped) {
          this.isStopped = true;
          var os = cloneArray(this.observers), len = os.length;

          if (this.hasValue) {
            for (i = 0; i < len; i++) {
              var o = os[i];
              o.onNext(this.value);
              o.onCompleted();
            }
          } else {
            for (i = 0; i < len; i++) {
              os[i].onCompleted();
            }
          }

          this.observers.length = 0;
        }
      }
888699
function notifyIsolated(self,cb,chain) {
		var ret, _then;
		try {
			if (cb === false) {
				chain.reject(self.msg);
			}
			else {
				if (cb === true) {
					ret = self.msg;
				}
				else {
					ret = cb.call(void 0,self.msg);
				}

				if (ret === chain.promise) {
					chain.reject(TypeError("Promise-chain cycle"));
				}
				else if (_then = isThenable(ret)) {
					_then.call(ret,chain.resolve,chain.reject);
				}
				else {
					chain.resolve(ret);
				}
			}
		}
		catch (err) {
			chain.reject(err);
		}
	}
1139147
@Override
    public void onSubscribe(Subscription subscription) {
        this.subscription = subscription;
        if (cancelled) {
            subscription.cancel();
            return;
        }
        if (deferredInitialMessageRequest > 0) {
            request(deferredInitialMessageRequest);
        }
    }
159958
def notify(self, reading):
        """"""
        # copy list before iterating in case new observers arrive
        for o in list(self._observers):
            o.update(self, reading)
926233
def notify_observers(self, joinpoint, post=False):
        

        _observers = tuple(self.observers)

        for observer in _observers:
            observer.notify(joinpoint=joinpoint, post=post)
470002
protected void notifyObservers (int level)
    {
        final int warningsLeft = getWarnings().length - level - 1;
        final long msLeft = _nextReboot - System.currentTimeMillis();
        _observers.apply(new ObserverList.ObserverOp<PendingShutdownObserver>() {
            public boolean apply (PendingShutdownObserver observer) {
                observer.shutdownPlanned(warningsLeft, msLeft);
                return true;
            }
        });
    }
651573
private void complete(Subscriber<? super T> subscriber) {
        if (!subscriber.isUnsubscribed()) {
            debug("onCompleted");
            subscriber.onCompleted();
        } else
            debug("unsubscribed");
    }
329031
void notifyListener() {
        Node<K, V> node;
        while ((node = pendingNotifications.poll()) != null) {
            listener.onEviction(node.key, node.getValue());
        }
    }
1252691
@Override
    public void onComplete() {


        counter.active.decrementAndGet();
        counter.subscription.removeValue(subscription);
        if (queue != null && counter.active.get() == 0) {

            if (counter.completable) {

                if(counter.closing.compareAndSet(false,true)) {
                    counter.closed = true;
                    queue.addContinuation(new Continuation(
                            () -> {
                                final List current = new ArrayList();
                                while (queue.size() > 0) {
                                    try {

                                        current.add(queue.get());
                                    }catch(ClosedQueueException e){

                                        break;
                                    }
                                }

                                throw new ClosedQueueException(
                                        current);
                            }));

                    queue.close();
                }
            }

        }

    }
1152794
private void considerNotify(ObserverWrapper observer) {
        if (!observer.mActive) {
            return;
        }
        // Check latest state b4 dispatch. Maybe it changed state but we didn't get the event yet.
        //
        // we still first check observer.active to keep it as the entrance for events. So even if
        // the observer moved to an active state, if we've not received that event, we better not
        // notify for a more predictable notification order.
        if (!observer.shouldBeActive()) {
            observer.activeStateChanged(false);
            return;
        }
        if (observer.mLastVersion >= mVersion) {
            return;
        }
        observer.mLastVersion = mVersion;
        //noinspection unchecked
        observer.mObserver.onChanged((T) mData);
    }
1159667
def end(self):
        
        self.send_headers()
        self.write()
        self.write_eof()
        self.has_ended = True
1059342
def _on_close(self, socket):
        
        self.logger.debug('Connection closed.')

        for subscription in self.subscriptions.values():
            if subscription.state == 'subscribed':
                subscription.state = 'connection_pending'
36114
def notify_step_begin_end(func):
    """"""

    @ft.wraps(func)
    def wrapper(self, *args, **kwargs):
        """Wrapper stub."""
        cls = self.__class__
        on_step_begin = cls.ON_STEP_BEGIN
        on_step_end = cls.ON_STEP_END

        for begin_listener in on_step_begin:
            begin_listener(self)

        res = func(self, *args, **kwargs)

        for end_listener in on_step_end:
            end_listener(self, func)
        return res

    return wrapper
119007
private void send(T value)
  {
    for (SubscriberNode sub : _subscribers) {
      sub.next(value);
    }
    
    long seq = _sequence++;
    int size = _consumers.size();
    
    if (size > 0) {
      int index = (int) (seq % size);
      
      _consumers.get(index).next(value);
    }
  }
107264
def notify_observers(self, event=None, msg=None):
        """"""
        for observer, events in list(self._observers.items()):
            # LOG.debug("trying to notify the observer")
            if events is None or event is None or event in events:
                try:
                    observer(self, event, msg)
                except (Exception,) as ex:  # pylint: disable=broad-except
                    self.unregister_observer(observer)
                    errmsg = "Exception in message dispatch: Handler '{0}' unregistered for event '{1}'  ".format(
                        observer.__class__.__name__, event)
                    LOG.error(errmsg, exc_info=ex)
6912
def _notify(self, data):
        """"""
        payload = tlv.decode(
            payload=data.get('payload'),
            content_type=data.get('ct'),
            decode_b64=True
        )
        super(CurrentResourceValue, self)._notify(payload)
        # after one response, close the channel
        self.ensure_stopped()
706399
public final synchronized void notifyCompletion() {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "notifyCompletion", "finishCount=" + _finishCount);

        if (--_finishCount < 0) {
            // may need to make final state transition here ?
            try {
                switch (_status.getState()) {
                    case TransactionState.STATE_COMMITTING:
                    case TransactionState.STATE_HEURISTIC_ON_COMMIT:
                        _status.setState(TransactionState.STATE_COMMITTED);
                        break;
                    case TransactionState.STATE_ROLLING_BACK:
                    case TransactionState.STATE_HEURISTIC_ON_ROLLBACK:
                        _status.setState(TransactionState.STATE_ROLLED_BACK);
                        break;

                    // one phase commit that resulted in retries ...
                    case TransactionState.STATE_PREPARING:
                    case TransactionState.STATE_COMMITTING_ONE_PHASE:
                        _status.setState(TransactionState.STATE_COMMITTED);
                } // end switch
            } catch (SystemException se) {
                FFDCFilter.processException(se, "com.ibm.tx.jta.TransactionImpl.notifyCompletion", "2416", this);
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "SystemException setting state during completion processing", se);
                // swallow this exception ... we're called in finally blocks!
            } finally {
                forgetTransaction(true);
            }
        } // end if
        if (tc.isEntryEnabled())
            Tr.exit(tc, "notifyCompletion");

    }