Adds new observers to the collection.

@param ConnectionObserver $observer
@return ConnectionObserverCollection this collection
167084
public function addObserver(ConnectionObserver $observer)
    {
        if (!in_array($observer, $this->observers, true)) {
            $this->observers[] = $observer;
        }
        return $this;
    }
269427
@SuppressWarnings("unchecked")
	public static ConnectionObserver childConnectionObserver(ServerBootstrap b) {
		Objects.requireNonNull(b, "bootstrap");
		ConnectionObserver obs = (ConnectionObserver) b.config()
		                                               .childOptions()
		                                               .get(OBSERVER_OPTION);
		if (obs == null) {
			return ConnectionObserver.emptyListener(); //will not be triggered in
		}
		b.childOption(OBSERVER_OPTION, null);
		return obs;
	}
1144855
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $customer = $observer->getEvent()->getCustomer();
        //New Automation enrolment to queue
        $this->automation->newCustomerAutomation($customer);

        return $this;
    }
657702
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        try {
            $wishlistItem = $observer->getEvent()->getItem();
            $emailWishlist = $this->emailWishlistCollection->create()
                ->getWishlistById($wishlistItem->getWishlistId());

            if ($emailWishlist) {
                $count = $emailWishlist->getItemCount();
                //update wishlist count and set to modified
                $emailWishlist->setItemCount(--$count);
                $emailWishlist->setWishlistModified(1);
                $this->emailWishlistResource->save($emailWishlist);
            }
        } catch (\Exception $e) {
            $this->helper->log((string)$e, []);
        }
    }
722722
public function attachObserver(ObserverInterface $observer, $event){
		$this->observers->attach($observer, $event);
		$this->connection->attachObserver($observer, $event);
		$e = new NeevoException;
		$e->attachObserver($observer, $event);
	}
1017623
public function add($oEntity)
    {
        $this->checkClass($oEntity);
        $this->values[$oEntity->getCollectionIndex()] = $oEntity;

        return $this;
    }
352902
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $additional = $observer->getAdditional();
        $conditions = (array) $additional->getConditions();
        $conditions = array_merge_recursive($conditions, [$this->getShopgateCondition()]);
        $additional->setConditions($conditions);

        return $this;
    }
422899
function attach(\SplObserver $observer)
    {
        if ($this->_observers == null)
        {
            $this->_observers = new \SplObjectStorage();
        }
        $this->_observers->attach($observer);
    }
1167379
public function ObserverRegister($sObserverName, &$oObserver)
    {
        if (!array_key_exists($sObserverName, $this->aObservers)) {
            $this->aObservers[$sObserverName] = &$oObserver;
        }
    }
1332244
public function hookToAddToWishlistBefore($observer)
    {
        $key = Mage::getSingleton('core/session')->getFormKey();
        $observer->getEvent()->getRequest()->setParam('form_key', $key);
        return $this;
    }
1250508
public boolean addObserver(ConnectionObserver obs) {
    boolean rv = conn.addObserver(obs);
    if (rv) {
      for (MemcachedNode node : conn.getLocator().getAll()) {
        if (node.isActive()) {
          obs.connectionEstablished(node.getSocketAddress(), -1);
        }
      }
    }
    return rv;
  }
716943
def addObserver(self, observer):
        
        with self._lock:
            self._weak_observers.append(weakref.ref(observer))
            if len(self._weak_observers) == 1:
                self.startThread()
645155
public function attach(ObserverInterface $observer)
	{
		if ($this->isAttached($observer)) {
			return false;
		}

		$this->observers[] = $observer;

		return true;
	}
153563
def addObserver(self, observer):
        """"""
        Observable.addObserver(self, observer)

        # If self.startOnDemand is True, the reader monitoring
        # thread only runs when there are observers.
        if self.startOnDemand:
            if 0 < self.countObservers():
                if not self.rmthread:
                    self.rmthread = ReaderMonitoringThread(
                        self,
                        self.readerProc, self.period)

                    # start reader monitoring thread in another thread to
                    # avoid a deadlock; addObserver and notifyObservers called
                    # in the ReaderMonitoringThread run() method are
                    # synchronized
                    try:
                        # Python 3.x
                        import _thread
                        _thread.start_new_thread(self.rmthread.start, ())
                    except:
                        # Python 2.x
                        import thread
                        thread.start_new_thread(self.rmthread.start, ())
        else:
            observer.update(self, (self.rmthread.readers, []))
115678
@Override
    public void addObserver(Observer observer) {
        super.addObserver(observer);
        if (countObservers() > 1) {
            super.deleteObserver(observer);
            AbstractConnectionFactoryService cfSvc = (AbstractConnectionFactoryService) observer;
            Object[] params = new Object[] { CONNECTION_MANAGER, name, cfSvc.getConfigElementName() };
            RuntimeException failure = connectorSvc.ignoreWarnOrFail(tc, null, UnsupportedOperationException.class, "CARDINALITY_ERROR_J2CA8040", params);
            if (failure != null)
                throw failure;
        }
    }
219467
public function subscribe( IObserver $observer ) : IObservable
   {

      if ( ! \in_array( $observer, $this->_observers, true ) )
      {
         $this->_observers[] = $observer;
      }

      return $this;

   }
42019
@Override
    public void addConfigObserver(final Observer<ConfigurableRemote<String, M, CONFIG>, CONFIG> observer) {
        configObservable.addObserver(observer);
    }