Maintain subscription status. Must be called by the user (or subclass)
 of this class, most likely in the thread created by #start.
324431
def handle_ack ack
      raise ArgumentError unless ack.control?
      op_type, tags = ack.control_op
      @sub_tracker.update op_type, tags
    end
17289
function() {
    this.subscribe('user', function(error, response) {
      if (!error && response) {
        logger.info('instagram -', 'users', 'subscription confirmed');
        Subscriber.prototype.subscriptions['users'] = response.id;
      }
    });
  }
123671
def check_subscription(self, request):
		""""""
		subscriber = subscriber_request_callback(request)

		if not subscriber_has_active_subscription(subscriber):
			if not SUBSCRIPTION_REDIRECT:
				raise ImproperlyConfigured("DJSTRIPE_SUBSCRIPTION_REDIRECT is not set.")
			return redirect(SUBSCRIPTION_REDIRECT)
293220
public void execute() {
        state = State.Running;
        for (Subscription sub : subscriptions) {
           sub.publish(this, message);
        }
        state = State.Finished;
        // This part is necessary to support the feature of publishing a DeadMessage or FilteredMessage
        // in case that the original message has not made it to any listener.
        // This happens if subscriptions are empty (due to GC of weak listeners or explicit desubscription)
        // or if configured filters do not let a message pass. The flag is set by the dispatchers.
        // META: This seems to be a suboptimal design
        if (!dispatched) {
            if (!isFilteredMessage() && !isDeadMessage()) {
                runtime.getProvider().publish(new FilteredMessage(message));
            } else if (!isDeadMessage()) {
                runtime.getProvider().publish(new DeadMessage(message));
            }

        }
    }
976527
def has_subscriber(self, user):
        
        if not hasattr(self, '_subscribers'):
            self._subscribers = list(self.subscribers.all())
        return user in self._subscribers
875
def post(self, request, *args, **kwargs):
        
        schedule_disable.delay(kwargs["subscription_id"])
        return Response({"accepted": True}, status=201)
1013299
def handle(self, *args, **options):
		""""""
		for subscriber in get_subscriber_model().objects.filter(djstripe_customers=None):
			# use get_or_create in case of race conditions on large subscriber bases
			Customer.get_or_create(subscriber=subscriber)
			print("Created subscriber for {0}".format(subscriber.email))
946531
def start (self):
        '''
        

        '''
        self.sub = rospy.Subscriber(self.topic, BumperEvent, self.__callback)
456223
def start(self):
        
        # initialize subscribers
        self._pointcloud_sub = rospy.Subscriber('/%s/depth/points' %(self.frame), PointCloud2, self._pointcloud_callback)
        self._camera_info_sub = rospy.Subscriber('/%s/left/camera_info' %(self.frame), CameraInfo, self._camera_info_callback)

        while self._camera_intr is None:
            time.sleep(0.1)
        
        self._running = True
420542
def _StopStatusUpdateThread(self):
    """"""
    self._status_update_active = False
    if self._status_update_thread.isAlive():
      self._status_update_thread.join()
    self._status_update_thread = None
431681
def status(self, **kwargs):
        
        self.services = dict(
            init_system=self.init_system,
            services=[]
        )
397355
def on_start(self):
        
        LOGGER.debug("zeromq.Subscriber.on_start")
        try:
            self.zmqsocket.connect(self.zmqbind_url)
            self.zmqsocket.setsockopt_string(zmq.SUBSCRIBE, self.zmqtopic)
        except Exception as e:
            LOGGER.error("error while subscribing ! " + e.__cause__)
            raise e
        self.subscriber = threading.Thread(target=self.run, name=self.subscriber_name)
        self.subscriber.start()
645858
def create(self):
        
        self.logger.debug('Create subscription on server...')

        if not self.connection.connected:
            self.state = 'connection_pending'
            return

        data = {
            'command': 'subscribe',
            'identifier': self._identifier_string()
        }

        self.connection.send(data)
        self.state = 'pending'
975882
def has_in_subscriptions(self, subscription):
        
        assert isinstance(subscription, github.Repository.Repository), subscription
        status, headers, data = self._requester.requestJson(
            "GET",
            "/user/subscriptions/" + subscription._identity
        )
        return status == 204
605949
def ensure_active_group(self):
        """"""
        with self._client._lock, self._lock:
            if self._heartbeat_thread is None:
                self._start_heartbeat_thread()

            while self.need_rejoin() or self._rejoin_incomplete():
                self.ensure_coordinator_ready()

                # call on_join_prepare if needed. We set a flag
                # to make sure that we do not call it a second
                # time if the client is woken up before a pending
                # rebalance completes. This must be called on each
                # iteration of the loop because an event requiring
                # a rebalance (such as a metadata refresh which
                # changes the matched subscription set) can occur
                # while another rebalance is still in progress.
                if not self.rejoining:
                    self._on_join_prepare(self._generation.generation_id,
                                          self._generation.member_id)
                    self.rejoining = True

                # ensure that there are no pending requests to the coordinator.
                # This is important in particular to avoid resending a pending
                # JoinGroup request.
                while not self.coordinator_unknown():
                    if not self._client.in_flight_request_count(self.coordinator_id):
                        break
                    self._client.poll()
                else:
                    continue

                # we store the join future in case we are woken up by the user
                # after beginning the rebalance in the call to poll below.
                # This ensures that we do not mistakenly attempt to rejoin
                # before the pending rebalance has completed.
                if self.join_future is None:
                    # Fence off the heartbeat thread explicitly so that it cannot
                    # interfere with the join group. Note that this must come after
                    # the call to _on_join_prepare since we must be able to continue
                    # sending heartbeats if that callback takes some time.
                    self._heartbeat_thread.disable()

                    self.state = MemberState.REBALANCING
                    future = self._send_join_group_request()

                    self.join_future = future  # this should happen before adding callbacks

                    # handle join completion in the callback so that the
                    # callback will be invoked even if the consumer is woken up
                    # before finishing the rebalance
                    future.add_callback(self._handle_join_success)

                    # we handle failures below after the request finishes.
                    # If the join completes after having been woken up, the
                    # exception is ignored and we will rejoin
                    future.add_errback(self._handle_join_failure)

                else:
                    future = self.join_future

                self._client.poll(future=future)

                if future.succeeded():
                    self._on_join_complete(self._generation.generation_id,
                                           self._generation.member_id,
                                           self._generation.protocol,
                                           future.value)
                    self.join_future = None
                    self.rejoining = False

                else:
                    self.join_future = None
                    exception = future.exception
                    if isinstance(exception, (Errors.UnknownMemberIdError,
                                              Errors.RebalanceInProgressError,
                                              Errors.IllegalGenerationError)):
                        continue
                    elif not future.retriable():
                        raise exception  # pylint: disable-msg=raising-bad-type
                    time.sleep(self.config['retry_backoff_ms'] / 1000)
64989
def register(self, subscriber):
        
        assert isinstance(subscriber, RequestHandler)
        logger.debug('New subscriber')
        self.subscribers.add(subscriber)
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