Get the process object for the specified consumer and process name.

        :param str consumer: The consumer name
        :param str name: The process name
        :returns: multiprocessing.Process
482912
def get_consumer_process(self, consumer, name):
        
        return self.consumers[consumer].processes.get(name)
1283014
public static <T> Consumer<T> pipeline(Consumer<T> consumer) {
        return new PipelinedConsumer<T>(Iterations.iterable(consumer));
    }
382221
def get_pipe(self, name):
        
        for pipe_name, component in self.pipeline:
            if pipe_name == name:
                return component
        raise KeyError(Errors.E001.format(name=name, opts=self.pipe_names))
1222963
def create_consumer(user, password, config_file_path, process_message, *args, **kwargs):
    ''''''
    queue_config = _read_json_file(filepath=config_file_path)

    exchanges = map(lambda x: queue_config['sources'][x]['exchange'], queue_config['sources'].keys())
    topics = map(lambda x: queue_config['sources'][x]['topic'], queue_config['sources'].keys())

    for i in range(0, len(exchanges)):
        LOG.info('Listening to (%s, %s)' % (exchanges[i], topics[i]))

    pulse_args = {
        # If the queue exists and is durable it should match
        'durable': queue_config['durable'] in ('true', 'True'),
        'password': password,
        'topic': topics,
        'user': user
    }

    if queue_config.get('applabel') is not None:
        pulse_args['applabel'] = queue_config['applabel']

    return PulseReplayConsumer(
        # A list with the exchanges of each element under 'sources'
        exchanges=exchanges,
        callback=process_message,
        **pulse_args
    )
    return consumer
1256117
public static <T> Consumer<T> consumer(CheckedConsumer<T> consumer) {
        return Unchecked.consumer(consumer, Unchecked.RETHROW_ALL);
    }
1020129
def pipeline(self, consumer):
        
        if self._pipeline is None:
            self._pipeline = ResponsePipeline(self)
            self.event('connection_lost').bind(self._close_pipeline)
        self._pipeline.put(consumer)
669097
def get_value(self, consumer=None):
        
        if consumer:
            self.consumers[consumer] = True
        return self.value
684503
def Queue(self, name, initial=None, maxsize=None):
        
        return types.Queue(name, self.api, initial=initial, maxsize=maxsize)
31876
def get_client(self, name):
        
        mech = self.get(name)
        return mech if isinstance(mech, ClientMechanism) else None
36881
public static <T> Consumer<T> consumer(CheckedConsumer<T> consumer) {
        return consumer(consumer, THROWABLE_TO_RUNTIME_EXCEPTION);
    }
47994
def new_consumer(self, config, consumer_name):
        
        return Consumer(0,
                        dict(),
                        config.get('qty', self.DEFAULT_CONSUMER_QTY),
                        config.get('queue', consumer_name))
1292666
def get_consumer_info(self, instance, cursor):
        """"""
        cursor.execute(self.CONSUMER_INFO_STATEMENT)
        for queue_name, consumer_name, lag, pending_events, last_seen in cursor:
            yield queue_name, consumer_name, {
                'lag': lag,
                'pending_events': pending_events,
                'last_seen': last_seen,
            }
1049583
def poll(self):
        
        self.set_state(self.STATE_ACTIVE)

        # If we don't have any active consumers, spawn new ones
        if not self.total_process_count:
            LOGGER.debug('Did not find any active consumers in poll')
            return self.check_process_counts()

        # Start our data collection dict
        self.poll_data = {'timestamp': time.time(), 'processes': list()}

        # Iterate through all of the consumers
        for proc in list(self.active_processes()):
            if proc == multiprocessing.current_process():
                continue

            # Send the profile signal
            os.kill(int(proc.pid), signal.SIGPROF)
            self.poll_data['processes'].append(proc.name)

        # Check if we need to start more processes
        self.check_process_counts()
83835
@Override
	public ProcessDefinition getProcessDefinition(String name) {
		for (ProcessDefinition pd: m_allProcesses) {
			if (pd.getName().equals(name)) {
				return pd;
			}
		}
		return null;
	}
925627
public List<String> getProcessList(String queueName)
    {
        // このメソッドを呼び出す前に、
        // this#initProcessLists()を利用してprocessListsを初期しておくこと。 
        if (this.processLists == null)
        {
            return null;
        }
        return getProcessLists().get(queueName);
    }
272654
def _instance_from_process(self, process):
    """"""
    return ProcessManager(name=process.name(),
                          pid=process.pid,
                          process_name=process.name(),
                          metadata_base_dir=self._metadata_base_dir)
15236
def start_consumers_for_queue(prefix_name="worker",
                              num_workers=2,
                              tasks=None,
                              queue_to_consume=None,
                              shutdown_msg="SHUTDOWN",
                              consumer_class=None,
                              need_response=False,
                              callback=None):
    

    consumers = []

    if not consumer_class:
        log.error("Please provide a consumer_class arg")
        log.error("  like: network_pipeline.packet_consumer.PacketConsumer")
        return consumers

    if not tasks:
        log.error("Missing tasks")
        return consumers

    if not queue_to_consume:
        log.error("Missing queue")
        return consumers

    # Establish communication queues
    log.info(("Creating consumers={} for cores={}")
             .format(multiprocessing.cpu_count(),
                     num_workers))

    for i in range(num_workers):
        consumers.append(consumer_class(
                            "{}-{}".format(prefix_name,
                                           i + 1),
                            tasks,
                            queue_to_consume,
                            shutdown_msg=shutdown_msg,
                            need_response=need_response,
                            callback=callback))

    log.info("Starting consumers={}".format(len(consumers)))
    for w in consumers:
        w.start()

    return consumers