Get a consumer for a connection.
59
def consumer(self, conn):
        """"""
        return Consumer(
            connection=conn,
            queue=self.queue.name,
            exchange=self.exchange.name,
            exchange_type=self.exchange.type,
            durable=self.exchange.durable,
            auto_delete=self.exchange.auto_delete,
            routing_key=self.routing_key,
            no_ack=self.no_ack,
        )
449973
public function lookup_consumer($consumer_key)
	{
		$returnValue = null;

		$consumer = $this->findOauthConsumerResource($consumer_key);
		$secret			= (string)$consumer->getUniquePropertyValue($this->getProperty(self::PROPERTY_OAUTH_SECRET));
		$callbackUrl	= null;
		
		$returnValue = new OAuthConsumer($consumer_key, $secret, $callbackUrl);

		return $returnValue;
	}
36881
public static <T> Consumer<T> consumer(CheckedConsumer<T> consumer) {
        return consumer(consumer, THROWABLE_TO_RUNTIME_EXCEPTION);
    }
181900
public static synchronized ReconnectionManager getInstanceFor(AbstractXMPPConnection connection) {
        ReconnectionManager reconnectionManager = INSTANCES.get(connection);
        if (reconnectionManager == null) {
            reconnectionManager = new ReconnectionManager(connection);
            INSTANCES.put(connection, reconnectionManager);
        }
        return reconnectionManager;
    }
1279916
def receiver(self):
        """"""
        try:
            return current_webhooks.receivers[self.receiver_id]
        except KeyError:
            raise ReceiverDoesNotExist(self.receiver_id)
43021
def get_client(self, request=None):
        """"""

        if not isinstance(request, oauth.Request):
            request = self.get_oauth_request()
        client_key = request.get_parameter('oauth_consumer_key')
        if not client_key:
            raise Exception('Missing "oauth_consumer_key" parameter in ' \
                'OAuth "Authorization" header')

        client = models.Client.get_by_key_name(client_key)
        if not client:
            raise Exception('Client "%s" not found.' % client_key)

        return client
639945
@Override
    public ConsumerManager getLocalPtoPConsumerManager()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "getLocalPtoPConsumerManager");

        ConsumerManager consumerManager = null;

        consumerManager = _ptoPRealization.getLocalPtoPConsumerManager();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "getLocalPtoPConsumerManager", consumerManager);

        return consumerManager;
    }
814829
public function getConsumer($thread, $queueName, $queueConfigurationId, $callback)
    {
        if (!isset($this->consumers[$thread][$queueName])) {
            $configuration = [
                RouterConfig::CONSUMER_CALLBACK               => $callback,
                RouterConfig::CONSUMER_QUEUE_CONFIGURATION_ID => $queueConfigurationId,
                RouterConfig::CONSUMER_QUEUE_NAME             => $queueName
            ];
            
            $consumer = new RouterConsumer($this, $thread, $configuration);
            $consumer->setup();
            
            $this->consumers[$thread][$queueName] = $consumer;
        }
        
        return $this->consumers[$thread][$queueName];
    }
877823
def add_consumer_from_dict(self, queue, **options):
        """"""
        options.setdefault("routing_key", options.pop("binding_key", None))
        consumer = Consumer(self.connection, queue=queue,
                            backend=self.backend, **options)
        self.consumers.append(consumer)
        return consumer
211097
def get_connection(self, name):
        
        return self._api_get('/api/connections/{0}'.format(
            urllib.parse.quote_plus(name)
        ))
497777
def _get_conn(self, host, port, afi):
        """"""
        host_key = (host, port)
        if host_key not in self._conns:
            self._conns[host_key] = BrokerConnection(
                host, port, afi,
                request_timeout_ms=self.timeout * 1000,
                client_id=self.client_id
            )

        conn = self._conns[host_key]
        if not conn.connect_blocking(self.timeout):
            conn.close()
            raise KafkaConnectionError("%s:%s (%s)" % (host, port, afi))
        return conn
929793
def connection(self):
        """"""
        try:
            con = self.thread.connection
        except AttributeError:
            con = self.steady_connection()
            self.thread.connection = con
        return con
82003
def consumer(self, service, data, to_update, status):
        
        # consumer - the service which uses the data
        service_consumer = default_provider.get_service(str(service.consumer.name.name))
        kwargs = {'user': service.user}
        getattr(service_consumer, '__init__')(service.consumer.token, **kwargs)
        instance = getattr(service_consumer, 'save_data')

        # 2) for each one
        for d in data:
            d['userservice_id'] = service.consumer.id
            # the consumer will save the data and return if success or not
            status = instance(service.id, **d)

            to_update = True

        return to_update, status
1087358
public ConsumerDispatcher getConsumerDispatcher() 
  {
    if (tc.isEntryEnabled()) 
    {
      SibTr.entry(tc, "getConsumerDispatcher");
      SibTr.exit(tc, "getConsumerDispatcher", consumerDispatcher);	
    }
    return consumerDispatcher;
  }
697198
def xinfo_consumers(self, stream, group_name):
        """"""
        fut = self.execute(b'XINFO', b'CONSUMERS', stream, group_name)

        return wait_convert(fut, parse_lists_to_dicts)
260554
def get_connections(self, id, connection_name, **args):
        """"""
        return self.request(
            "{0}/{1}/{2}".format(self.version, id, connection_name), args
        )
395333
public User getcurrentUser(String consumerKey, String consumerSecret,
			String accessToken, String accessTokenSecret)
			throws ConnectionException {
		httpClient = new PlatformHttpClient(consumerKey, consumerSecret,
				accessToken, accessTokenSecret);
		User user = null;;
		try {
			user = this.httpClient.getCurrentUser();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return user;
	}