Subscribe to each subscription
@param {Object} [subscriptions] An optional hash of subscription to add
331406
function(subscriptions){
      if (subscriptions) _.extend(this.subscriptions || {}, subscriptions);
      subscriptions = subscriptions || this.subscriptions;
      if (!subscriptions || _.isEmpty(subscriptions)) return;
      // Just to be sure we don't set duplicate
      this.unsetSubscriptions(subscriptions);

      _.each(subscriptions, function(subscription, channel){
        var once;
        if (subscription.$once) {
          subscription = subscription.$once;
          once = true;
        }
        if (_.isString(subscription)) {
          subscription = this[subscription];
        }
        Backbone.Mediator.subscribe(channel, subscription, this, once);
      }, this);
    }
67436
public function update($subscriptions)
    {
        $this->initCollection();

        /** @var SubscriptionInterface $subscription */
        foreach ($subscriptions as $subscription) {
            $this->changeSubscription(
                $subscription,
                (bool)$subscription->getSubscriberStatus() === true ?
                    Subscriber::STATUS_SUBSCRIBED :
                    Subscriber::STATUS_UNSUBSCRIBED
            );
        }

        return $this->statusResponseFactory->create()
            ->setStatus('ok');
    }
787950
function (subscriptions, fn, context) {
  for (var id in subscriptions) {
    for (var property in subscriptions[id]) {
      fn.call(context, subscriptions[id][property], property, id);
    }
  }
}
415611
function store_subscription( FS_Subscription $subscription ) {
            if ( ! isset( $this->_storage->subscriptions ) ) {
                $this->_storage->subscriptions = array();
            }

            if ( empty( $this->_storage->subscriptions ) || ! is_multisite() ) {
                $this->_storage->subscriptions = array( $subscription );

                return;
            }

            $subscriptions = $this->_storage->subscriptions;

            $updated_subscription = false;
            foreach ( $subscriptions as $key => $existing_subscription ) {
                if ( $existing_subscription->id == $subscription->id ) {
                    $subscriptions[ $key ] = $subscription;
                    $updated_subscription  = true;
                    break;
                }
            }

            if ( ! $updated_subscription ) {
                $subscriptions[] = $subscription;
            }

            $this->_storage->subscriptions = $subscriptions;
        }
480995
function(subscriptions){
      subscriptions = subscriptions || this.subscriptions;
      if (!subscriptions || _.isEmpty(subscriptions)) return;
      _.each(subscriptions, function(subscription, channel){
        if (_.isString(subscription)) {
          subscription = this[subscription];
        }
        Backbone.Mediator.unsubscribe(channel, subscription.$once || subscription, this);
      }, this);
    }
1202346
def subscribe(caller = nil, &block)
      if block_given?
        notify_when = block.call(state)
        @listeners << { obj: block.binding.receiver, notify_when: notify_when }
      else
        @listeners << { obj: caller }
      end
    end
340696
def index
      @subscriptions = Subscription.all
  
      respond_to do |format|
        format.html # index.html.erb
        format.json { render json: @subscriptions }
      end
    end
458107
function Subscription () {
  this._id = null

  this._storeRelations = null
  this._memberRelations = null
  this._dependencyRelations = null

  this._events = {
    'beforePublish': [],
    'afterPublish': []
  }

  this._subscriptionStream = null
  this._stream = null
  this._lastData = null

  this._muted = false

  storeRelation.constructParent(this)
  memberRelation.constructParent(this)
  dependencyRelation.constructParent(this)

  subscription.apply(this, arguments)
}
1144035
def get_subscriptions(self, fetch=False):
        """"""
        return Subscriptions(
            self.resource.subscriptions, self.client, populate=fetch)
632013
function subscribe() {
  console.log('Subscribing client ' + clientId + ' to topic: ' + topics.subscribe);
  client.subscribe(topics.subscribe);
  isSubscribed = true;
}
327591
def subscriptions(options = {})
      batches = Enumerator.new do |y|
        resp = @client.list_subscriptions(options)
        resp.each_page do |page|
          batch = []
          page.data.subscriptions.each do |s|
            batch << Subscription.new(
              arn: s.subscription_arn,
              client: @client
            )
          end
          y.yield(batch)
        end
      end
      Subscription::Collection.new(batches)
    end
356854
public void assertSubscriptions() {
        for (String channel : subscribers.keySet()) {
            try {
                subscribers.put(channel, null);
                subscribe(channel);
            } catch (Throwable e) {
                break;
            }
        }
    }
111248
def _add_subscribers_for_type(self, callback_type, subscribers, callbacks, **kwargs):
        '''  '''
        for subscriber in subscribers:
            callback_name = 'on_' + callback_type
            if hasattr(subscriber, callback_name):
                _function = functools.partial(getattr(subscriber, callback_name), **kwargs)
                callbacks.append(_function)
274184
function (fn, update, container) {
  // Alias passed in variables for later access.
  this._fn        = fn;
  this._update    = update;
  this._container = container;

  // Assign every subscription instance a unique id. This helps with linking
  // between parent and child subscription instances.
  this.cid             = 'c' + Utils.uniqueId();
  this.children        = {};
  this.subscriptions   = {};
  this.unsubscriptions = [];

  // Create statically bound function instances for public consumption.
  this.boundUpdate         = Utils.bind(this.update, this);
  this.boundUnsubscription = Utils.bind(this.unsubscription, this);
}
666670
function indexSubscribers() {
  const { subscribers = {} } = getComponentsSettings();

  return index({
    file: 'subscribers.js',
    config: {
      type: TYPE_SUBSCRIBERS,
      config: subscribers,
      exportsStart: 'export default [',
      exportsEnd: '];',
      isArray: true,
    },
    defaultContent: 'export default [];\n',
    ...getIndexLogTranslations(TYPE_SUBSCRIBERS),
  });
}
662558
public IPromise<KSubscription> _subscribe( Callback subscriber ) {
        if ( subscribers == null )
            subscribers = new HashMap<>();
        int id = subsIdCount++;
        KSubscription subs = new KSubscription(self(), id);
        subscribers.put( id, new SubscriberEntry(id, subs, subscriber) );
        return new Promise<>(subs);
    }
606202
public function subscribe($events)
    {
        $events->listen(
            Added::class,
            'Laranix\Auth\User\Groups\Events\Subscriber@onAdded'
        );

        $events->listen(
            Updated::class,
            'Laranix\Auth\User\Groups\Events\Subscriber@onUpdated'
        );

        $events->listen(
            Removed::class,
            'Laranix\Auth\User\Groups\Events\Subscriber@onRemoved'
        );
    }