Subscribes itself to a publisher

@param MW_Observer_Publisher_Interface $p Object implementing publisher interface
764355
public function register( MW_Observer_Publisher_Interface $p )
	{
		$p->addListener( $this, 'setAddress.after' );
		$p->addListener( $this, 'deleteAddress.after' );
		$p->addListener( $this, 'addProduct.after' );
		$p->addListener( $this, 'deleteProduct.after' );
		$p->addListener( $this, 'addCoupon.after' );
		$p->addListener( $this, 'deleteCoupon.after' );
	}
1255065
public void setPublishEngine(CmsPublishEngine publishEngine) {

        if (m_frozen) {
            throw new CmsRuntimeException(Messages.get().container(Messages.ERR_CONFIG_FROZEN_0));
        }
        m_publishEngine = publishEngine;
    }
996410
public void subscribe(int subsId, String tableName, String filter, String reducedFields[], Callback<ChangeMessage> changeReceiver) {
        if (filter == null || filter.trim().length() == 0 || filter.trim().equals("true"))
            filter = "1";
        ChangeStream table = tableFactory.apply(tableName);
        if (table == null) {
            changeReceiver.complete(null, "unknown table");
        } else {
            Subscriber subscriber;
            try {
                subscriber = table.subscribeOn(filter, change -> {
                    if (reducedFields != null && reducedFields.length > 0) {
                        change = change.reduced(reducedFields);
                    }
                    changeReceiver.pipe(change);
                });
            } catch (QParseException e) {
                changeReceiver.reject("ParseException:" + e.getMessage());
                Log.Error(this,e);
                return;
            }
            subsMap.put(subsId, new FrontEndSubscription(subscriber, tableName, changeReceiver));
        }
    }
1166403
private void publishEvent(WSJobExecution objectToPublish, String eventToPublishTo) {
        if (getBatchEventsPublisher() != null) {
            getBatchEventsPublisher().publishJobExecutionEvent(objectToPublish, eventToPublishTo, correlationId);
        }
    }
640114
public void subscribe(Reference reference) {
		getResourceFactory()
				.getApiResource(
						"/subscription/" + reference.toURLFragment(false))
				.entity(new Empty(), MediaType.APPLICATION_JSON_TYPE).post();
	}
1045597
private void publishEvent(WSJobInstance objectToPublish, String eventToPublishTo, String correlationId) {
        if (eventsPublisher != null) {
            eventsPublisher.publishJobInstanceEvent(objectToPublish, eventToPublishTo, correlationId);
        }
    }
262106
@Override
	public void registerConsumer(LocalMessageConsumer consumer)
    {
        super.registerConsumer(consumer);
        
        subscriptionsLock.writeLock().lock();
        try
		{
        	LocalTopicSubscription subscription = subscriptionMap.remove(consumer.getSubscriberId());
        	if (subscription == null)
        	{
        		// New subscription
        		storeNewSubscription(consumer);
        	}
        	else
        	{
        		// Remove old subscription
        		removeSubscription(subscription);
        		// Replace by new subscription
        		storeNewSubscription(consumer);
        	}
		}
        finally
        {
        	subscriptionsLock.writeLock().unlock();
        }
    }
860409
protected function addPublish(Builder $builder): void
    {
        $builder->macro('publish', function (Builder $builder) {
            $builder->withNotPublished();

            return $builder->update(['published_at' => Date::now()]);
        });
    }
295586
static function subscribed($to)
    {
        $xml = self::maker($to, false, false, false, 'subscribed');
        \Moxl\API::request($xml);
    }
2772
public function attach(ObserverInterface $observer): SubjectInterface
   {
       if ($observer instanceof PDFTemplate) {
           parent::attach($observer);
       }
       return $this;
   }
993390
public void subscribeTo(final K key, final Subscriber<V> subscriber) {
        registered.get(key)
                  .stream()
                  .subscribe(subscriber);

    }
299154
public function psubscribe($pattern /* ... */)
    {
        $this->writeRequest(self::PSUBSCRIBE, func_get_args());
        $this->statusFlags |= self::STATUS_PSUBSCRIBED;
    }
1036354
public <T extends EventListener> void subscribe(EventPublisher source, T listener) {
	if (source == null || listener == null) {
	    throw new IllegalArgumentException("Parameters cannot be null");
	}
	log.debug("[subscribe] Adding {} --> {}", source.getClass().getName(), listener.getClass().getName());

	GenericEventDispatcher<T> dispatcher = (GenericEventDispatcher<T>) dispatchers.get(source);
	if (dispatcher == null) {
	    log.warn("[subscribe] Registering with a disconnected source");
	    dispatcher = createDispatcher(source);
	}

	dispatcher.addListener(listener);

    }
675288
public void subscribe(NavigationViewModel navigationViewModel) {
    this.navigationViewModel = navigationViewModel;
    LifecycleOwner owner = (LifecycleOwner) getContext();
    navigationViewModel.instructionModel.observe(owner, new Observer<InstructionModel>() {
      @Override
      public void onChanged(@Nullable InstructionModel model) {
        if (model != null) {
          updateDataFromInstruction(model);
        }
      }
    });
    navigationViewModel.bannerInstructionModel.observe(owner, new Observer<BannerInstructionModel>() {
      @Override
      public void onChanged(@Nullable BannerInstructionModel model) {
        if (model != null) {
          updateManeuverView(model.retrievePrimaryManeuverType(), model.retrieveSecondaryManeuverModifier(),
            model.retrievePrimaryRoundaboutAngle());
          updateDataFromBannerText(model.retrievePrimaryBannerText(), model.retrieveSecondaryBannerText());
          updateSubStep(model.retrieveSubBannerText(), model.retrievePrimaryManeuverType());
        }
      }
    });
    navigationViewModel.isOffRoute.observe(owner, new Observer<Boolean>() {
      @Override
      public void onChanged(@Nullable Boolean isOffRoute) {
        if (isOffRoute != null) {
          if (isOffRoute) {
            showRerouteState();
          } else if (isRerouting) {
            hideRerouteState();
            alertView.showReportProblem();
          }
          isRerouting = isOffRoute;
        }
      }
    });
    subscribeAlertView();
    initializeButtonListeners();
    showButtons();
  }
1283458
public function isSubscribed(EventPublisherInterface $publisher)
    {
        $handle = $publisher->getHandle();
        return isset($this->__publishers[$handle]);
    }
1279607
def subscribe(subscription)
      @logger.info "Subscribing to: #{subscription + '*'}"
      pubsub.psubscribe(subscription + '*') do |chan, msg|
        @logger.info "pushing c: #{chan} msg: #{msg}"
        channel(chan).push(msg)
      end
    end
824376
public function afterAdd($p, $m)
    {
        if ($p->titleForModel) {
            $m->title_field = $p->titleForModel;
        }

        foreach ($this->fieldsForModel as $field=>$def) {
            if ($m->hasField($field)) {
                continue;
            }

            // add new field
            $m->addField($field, $def);
        }
    }