{@inheritDoc}

@param observer {@inheritDoc}
552674
@Override
    public void removeObserver(final Observer<S, T> observer) {
        synchronized (OBSERVER_LOCK) {
            observers.remove(observer);
        }
    }
911812
public function attach(EventObserverInterface $observer)
    {
        $key = $this->getRegistrationKey($observer);

        if (empty($this->observers[$key])) {
            $this->observers[$key] = $observer;
        }
    }
140282
def add_observer(self, observer, callble, priority=0):
        
        self.observers.add(priority, observer, callble)
1244046
@Override
    public void removeSynchronizationObserver(Observer<Registry<KEY, ENTRY>, Long> observer) {
        synchronisationObservable.removeObserver(observer);
    }
1055960
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $productCollection = $observer->getEvent()->getData('product_collection');
        $storeId           = $observer->getEvent()->getData('store_id');

        if (($productCollection instanceof \Magento\Catalog\Model\ResourceModel\Product\Collection) && $storeId) {
            $this->logEvent($productCollection, $storeId);
        }
    }
1321417
protected void addObserver (Object obs)
    {
        if (_observers == null) {
            _observers = ObserverList.newFastUnsafe();
        }
        _observers.add(obs);
    }
645155
public function attach(ObserverInterface $observer)
	{
		if ($this->isAttached($observer)) {
			return false;
		}

		$this->observers[] = $observer;

		return true;
	}
167084
public function addObserver(ConnectionObserver $observer)
    {
        if (!in_array($observer, $this->observers, true)) {
            $this->observers[] = $observer;
        }
        return $this;
    }
722722
public function attachObserver(ObserverInterface $observer, $event){
		$this->observers->attach($observer, $event);
		$this->connection->attachObserver($observer, $event);
		$e = new NeevoException;
		$e->attachObserver($observer, $event);
	}
1146275
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $cookieNames = $this->getCookies();

        $metadata = $this->cookieMetadataFactory->createPublicCookieMetadata();
        $metadata->setPath($this->getCookieConfiguration()['path'] ?? '/');

        foreach ($cookieNames as $cookieName) {
            $this->cookieManager->deleteCookie($cookieName, $metadata);
        }
    }
736616
protected function observe($observer)
    {
        if (method_exists($observer, 'saving')) {
            $this->hook('saving', array($observer, 'saving'));
        }

        if (method_exists($observer, 'saved')) {
            $this->hook('saved', array($observer, 'saved'));
        }

        if (method_exists($observer, 'filtering')) {
            $this->hook('filtering', array($observer, 'filtering'));
        }

        if (method_exists($observer, 'filtered')) {
            $this->hook('filtered', array($observer, 'filtered'));
        }

        if (method_exists($observer, 'removing')) {
            $this->hook('removing', array($observer, 'removing'));
        }

        if (method_exists($observer, 'removed')) {
            $this->hook('removed', array($observer, 'removed'));
        }

        if (method_exists($observer, 'searching')) {
            $this->hook('searching', array($observer, 'searching'));
        }

        if (method_exists($observer, 'searched')) {
            $this->hook('searched', array($observer, 'searched'));
        }

        if (method_exists($observer, 'attaching')) {
            $this->hook('attaching', array($observer, 'attaching'));
        }

        if (method_exists($observer, 'attached')) {
            $this->hook('attached', array($observer, 'attached'));
        }

        if (method_exists($observer, 'initialized')) {
            $this->hook('initialized', array($observer, 'initialized'));
        }
    }
1271363
public function execute(Observer $observer)
    {
        /** @var Subscriber $subscriber */
        $subscriber = $observer->getSubscriber();

        try {
            $store = $this->storeManager->getStore($subscriber->getStoreId());

            if ($subscriber->getCustomerId()) {
                $this->customerEventHandler->store(
                    $subscriber->getCustomerId(),
                    $store->getWebsiteId(),
                    $store->getId()
                );
            } else {
                $this->subscriptionEventHandler->store(
                    $subscriber,
                    $store->getWebsiteId(),
                    $store->getId(),
                    $this->subscriptionEventHandler->getEventType($observer->getEvent()->getName())
                );
            }
        } catch (\Exception $e) {
            $this->logger->warning('Emartech\\Emarsys\\Observers\\SubscriptionObserver: ' . $e->getMessage());
        }
    }
597820
public function attach(ServerObserver $observer)
    {
        if ($this->state) {
            throw new \Error("Cannot attach observers after the server has started");
        }

        $this->observers->attach($observer);
    }
1016095
public void trigger(Object event){

        Set<Class> eventTypes = getAllInheritedClasses(event.getClass());

        for (Class eventType : eventTypes) {
            if(observers.containsKey(eventType)){
                for (EventObserver eventObserver : observers.get(eventType)) {
                    executionQueue.get().add(new EventExecution(event, eventObserver));
                }
            }
        }

        triggerQueue();
    }
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;
    }
299909
private int indexOf(ApptentiveNotificationObserver observer) {
		for (int i = 0; i < observers.size(); ++i) {
			final ApptentiveNotificationObserver other = observers.get(i);
			if (other == observer) {
				return i;
			}

			final ObserverWeakReference otherReference = ObjectUtils.as(other, ObserverWeakReference.class);
			if (otherReference != null && otherReference.get() == observer) {
				return i;
			}
		}
		return -1;
	}
382855
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        /** define local working data */
        /** @var \Magento\Catalog\Model\Product $product */
        $product = $observer->getData(self::DATA_PRODUCT);

        /** perform processing */
        if ($product instanceof \Magento\Catalog\Model\Product) {
            $product->setSpecialPrice(null);
        }
    }