Modifies what kind of events the app wishes to subscribe to.
        
        Returns the updated `push subscription dict`_.
497527
def push_subscription_update(self, follow_events=None, 
                              favourite_events=None, reblog_events=None, 
                              mention_events=None):
        
        params = {}
        
        if follow_events != None:
            params['data[alerts][follow]'] = follow_events
        
        if favourite_events != None:
            params['data[alerts][favourite]'] = favourite_events
            
        if reblog_events != None:
            params['data[alerts][reblog]'] = reblog_events
            
        if mention_events != None:
            params['data[alerts][mention]'] = mention_events
            
        return self.__api_request('PUT', '/api/v1/push/subscription', params)
884930
def auto_subscribe(self, app_manager):
        """"""
        for handler in app_manager.handler_classes:
            app_manager.subscribe(handler.channel(), self)
323381
function subscribeToEvents() {
    const socket = _socket.get(this);

    function onEventApiError(error) {
        dbg('Event API connection error: ' + JSON.stringify(error));
    }

    socket.on('pong', (latency) => {
        dbg(`Event API latency: ${latency} ms`);
    });
    socket.on('connect_error', onEventApiError);
    socket.on('error', onEventApiError);
    socket.on('disconnect', onEventApiError);
    socket.on('reconnect_error', onEventApiError);
    socket.on('reconnect_failed', () => {
        onEventApiError('Reconnecting to the Event API failed');
    });

    socket.on('new_receipt', receiptJSON => {
        const receipt = Receipt.from(receiptJSON, _provider.get(this));
        _eventEmitter.get(this).emit(EventNames.newReceipt, receipt);
    });
}
1232194
def update(self, *args, **kwargs):
        
        super(DictProxy, self).update(*args, **kwargs)
        return self
1113483
def update_subscription(netid, action, subscription_code, data_field=None):
    
    url = '{0}/subscription.json'.format(url_version())
    action_list = []

    if isinstance(subscription_code, list):
        for code in subscription_code:
            action_list.append(_set_action(
                netid, action, code, data_field))
    else:
        action_list.append(_set_action(
            netid, action, subscription_code, data_field))

    body = {'actionList': action_list}
    response = post_resource(url, json.dumps(body))
    return _json_to_subscription_post_response(response)
166687
def remove(self, event, subscriber):
        
        subs = self._subscribers
        if event not in subs:
            raise ValueError('No subscribers: %r' % event)
        subs[event].remove(subscriber)
1028074
def add_subscriber(self, connection_id, subscriptions,
                       last_known_block_id):
        
        with self._subscribers_cv:
            self._subscribers[connection_id] = \
                EventSubscriber(
                    connection_id, subscriptions, last_known_block_id)

        LOGGER.debug(
            'Added Subscriber %s for %s', connection_id, subscriptions)
579415
def handle_event(self, event):
        
        subscription_id = event.subscription_id
        if subscription_id in self._subscriptions:
            # FIXME: [1] should be a constant
            handler = self._subscriptions[subscription_id][SUBSCRIPTION_CALLBACK]
            WampSubscriptionWrapper(self,handler,event).start()
886821
function subscribe() {
  openSTNotification.subscribeEvent.rabbit(
    ['#'],
    {queue: 'openst_platform'},
    function (msgContent) {
      logger.debug('[RECEIVED]', msgContent, '\n');
    }
  ).catch(function (err) {
    logger.error(err);
  });
}
1186683
def subscribe( event, handler )

      @events = %w{ onSendRequest onProcessResponse onSetActiveTable
                    onRequestSucceeded onRequestFailed onSetActiveRecord
                    onSetActiveField } if @events.nil?

      if @events.include?( event )
         if handler and handler.is_a?( EventHandler )
            if @eventSubscribers.nil?
               @eventSubscribers = {}
            end
            if not @eventSubscribers.include?( event )
               @eventSubscribers[ event ] = []
            end
            if not @eventSubscribers[ event ].include?( handler )
               @eventSubscribers[ event ] << handler
            end
         else
            raise "subscribe: 'handler' must be a class derived from QuickBase::EventHandler."
         end
      else
         raise "subscribe: invalid event '#{event}'.  Valid events are #{@events.sort.join( ', ' )}."
      end
   end
840002
def listen_for_updates(self):
        """"""
        self.toredis.subscribe(self.group_pubsub, callback=self.callback)
481811
def subsite_upcoming_events(context):
    
    request = context['request']
    home = request.site.root_page
    return {'request': request,
            'events':  getAllUpcomingEvents(request, home=home)}
728923
function subscribe() {
    // starts to receive values after device regsiters
    connect.subscribe.resourceValues({ resourcePaths: ["/3200/0/5501"] })
        .addListener((res) => logData(res, "OnRegistration"))
        .addLocalFilter(res => res.payload >= 20);

    // starts to reveive values immediatley
    connect.subscribe.resourceValues({ resourcePaths: ["/3200/0/5501"] }, "OnValueUpdate")
        .addListener((res) => logData(res, "OnValueUpdate"));
}
743553
def _update_events(self):
        """"""
        events = self._skybell.dev_cache(self, CONST.EVENT) or {}

        for activity in self._activities:
            event = activity.get(CONST.EVENT)
            created_at = activity.get(CONST.CREATED_AT)

            old_event = events.get(event)

            if old_event and created_at < old_event.get(CONST.CREATED_AT):
                continue
            else:
                events[event] = activity

        self._skybell.update_dev_cache(
            self,
            {
                CONST.EVENT: events
            })
333792
function(channel, subscription, context, once) {
      if (!channels[channel]) channels[channel] = [];
      channels[channel].push({fn: subscription, context: context || this, once: once});
    }
660716
def list_subscriptions(self, service):
        """"""
        data = {
            'service': service,
        }
        return self._perform_post_request(self.list_subscriptions_endpoint, data, self.token_header)
390680
def modify_subscription_status(netid, subscription_code, status):
    
    url = _netid_subscription_url(netid, subscription_code)
    body = {
        'action': 'modify',
        'value': str(status)
    }

    response = post_resource(url, json.dumps(body))
    return _json_to_subscriptions(response)