Creates a new Producer to open the specified Production.
553503
def open_production(production_path)
      Thread.new { Java::limelight.Context.instance.studio.open(production_path) }
    end
788656
public static <X, T> ProducerMethod<X, T> of(BeanAttributes<T> attributes, EnhancedAnnotatedMethod<T, ? super X> method, AbstractClassBean<X> declaringBean, DisposalMethod<X, ?> disposalMethod, BeanManagerImpl beanManager, ServiceRegistry services) {
        return new ProducerMethod<X, T>(createId(attributes, method, declaringBean), attributes, method, declaringBean, disposalMethod, beanManager, services);
    }
1315829
def producer(cfg_uri, queue, logger=None):
    
    _info, _exception = _deal_logger(logger)
    cfg_uri = _deal_uri(cfg_uri)

    def decorator(function):
        @wraps(function)
        def wapper(*args, **kwargs):
            client = _conn(cfg_uri, queue, _info)
            for item in function(*args, **kwargs):
                try:
                    if not isinstance(item, dict):
                        item = {'data': item}
                    data = dumps(item, ensure_ascii=False)
                    client.send(queue, data, headers={'persistent': 'true'})
                    _info('Producer insert %s - %s' % (queue, item))
                except ProducerFatalError, e:
                    _exception(e)
                    break
                except Exception, e:
                    _exception(e)
            client.disconnect()
            _info('disconnected %s' % cfg_uri)
        return wapper
    return decorator
1029412
public <K extends Serializable & Comparable> Process<K> newProcess()
    {
        final String queueOwner = partition == null ? null : partition.getQueueOwnerKey();
        Callback<ProcessWrapper<K>> callback = new Callback<ProcessWrapper<K>>() {

            @Override
            protected void doAction() {

                ProcessWrapper<K> process = ProcessWrapper.getNewInstance(
                        queueOwner, is_persistent, implementation_options);

                ProcessPersistence<ProcessEntity<K>,K> processHome = 
                        process.setDetails(process_name, queue, process_description, user,
                                           occurrence, visibility, access, resilience, output,
                                           pre_processes, post_processes, keep_completed,
                                           process_listeners, locale, implementation_options);

                if (report_type != null)
                    process.setReportType(report_type);

                if(source_name != null)
                    process.setSourceName(source_name);

                setupProcess(new Process(process));

                preSubmitBatchJobProcessing();

                if (is_persistent) processHome.persist();

                process.getContainingServer().submitProcess(process);

                _return(process);
            }
        };

        QueujTransaction<K> transaction = (QueujTransaction<K>)QueujFactory.getTransaction();
        return new Process<K>(transaction.doTransaction(queueOwner, is_persistent, callback, true));
    }
826468
public T newInstance(Map<String, Object> fields)
	{
		try
		{
			FactoryDefinition<T> bestDef = factories[0];
			int bestScore = bestDef.getScore(fields);

			for(int i=1, n=factories.length; i<n; i++)
			{
				int score = factories[i].getScore(fields);
				if(score > bestScore)
				{
					bestDef = factories[i];
					bestScore = score;
				}
			}

			return bestDef.create(fields);
		}
		catch(RuntimeException e)
		{
			throw new RuntimeException("Could not create " + type + "; " + e.getMessage(), e);
		}
	}
539885
protected KafkaProducer<String, byte[]> createProducer(Properties props) {
    return this.closer.register(new KafkaProducer<String, byte[]>(props));
  }
628411
protected final FactoryPersistableBase
    createPutFactoryPersistableBase(
      final Class<?> pBeanClass) throws Exception {
    FactoryPersistableBase factory = new FactoryPersistableBase();
    factory.setObjectClass(pBeanClass);
    factory.setDatabaseId(this.srvDatabase.getIdDatabase());
    //assigning fully initialized object:
    this.factoriesMap
      .put(pBeanClass, factory);
    return factory;
  }
415990
public T create(final CreationalContext<T> creationalContext) {
        T instance = getProducer().produce(creationalContext);
        instance = checkReturnValue(instance);
        return instance;
    }
1101645
def create_consumer(self):
        """"""
        with self.connection_pool.acquire(block=True) as conn:
            yield self.consumer(conn)
604654
protected <T> void createObserversProducersDisposers(AbstractClassBean<T> bean) {
        if (bean instanceof ManagedBean<?> || bean instanceof SessionBean<?>) {
            // disposal methods have to go first as we want them to be ready for resolution when initializing producer method/fields
            createDisposalMethods(bean, bean.getEnhancedAnnotated());
            createProducerMethods(bean, bean.getEnhancedAnnotated());
            createProducerFields(bean, bean.getEnhancedAnnotated());
            if (manager.isBeanEnabled(bean)) {
                createObserverMethods(bean, bean.getEnhancedAnnotated());
            }
        }
    }
1025276
@Override
	public <T extends Endpoint> Strategy<T> create() {
		return new RoundRobinStrategy<T>(broker, preferLocal);
	}
485706
public Producer createProducer() throws Exception {
        LOG.debug(this.toString());
        ObjectHelper.notNull(this.mode, "mode");
        GpioPin pin = isAlreadyProvisioned();
        if (pin == null) {
            switch (this.mode) {
            case DIGITAL_OUTPUT:
                pin = getOrCreateController().provisionDigitalOutputPin(getPin(), state);
                break;
            case ANALOG_OUTPUT:
                pin = getOrCreateController().provisionAnalogOutputPin(getPin(), value);
                break;
            case PWM_OUTPUT:
                pin = getOrCreateController().provisionPwmOutputPin(getPin(), (int) value);
                break;
            case ANALOG_INPUT: // PinMode.allInput()
            case DIGITAL_INPUT:
                LOG.error("Cannot create Producer with INPUT Mode");
                return null;
            default:
                LOG.error("Cannot create Producer w/o Mode");
                break;
            }
            pin.setMode(this.mode); // Force Mode to avoid NPE
        } else { // enhancement we could manage several pins with one producer
            throw new IllegalArgumentException(
                    "Cannot create twice same output gpio [" + this.gpioId + "] for Producer");
        }

        // shutdownOption(pin);
        return new GPIOProducer(this, pin, action);
    }
865432
public void setProducer(org.apache.kafka.clients.producer.KafkaProducer<Object, Object> producer) {
        this.producer = producer;
    }
680156
@Override
  public QueueDeliver<M> build(Supplier<Deliver<M>> factory, 
                               int workerCount)
  {
    Objects.requireNonNull(factory);
    validateBuilder();
    
    if (workerCount <= 0) {
      throw new IllegalArgumentException();
    }
    
    if (workerCount == 1) {
      return build(factory.get());
    }

    QueueRing<M> queueDeliver = buildQueue();
    
    //Objects.requireNonNull(processors);
      
    @SuppressWarnings("unchecked")
    WorkerDeliver<M>[] workers = new WorkerDeliver[workerCount];
      
    Executor executor = createExecutor();
    ClassLoader loader = getClassLoader();
      
    for (int i = 0; i < workers.length; i++) {
      Deliver<M> deliver = factory.get();
      
      workers[i] = new WorkerDeliverMultiThread<M>(deliver,
                                                   _outboxContext,
                                                   executor, loader, 
                                                   queueDeliver);
    }
      
    WorkerDeliver<M> worker
      = new WorkerDeliverMultiCoordinator<>(queueDeliver, 
                                          workers,
                                          multiworkerOffset());
    
    return new QueueDeliverImpl<M>(queueDeliver, worker);
  }
1119526
private ExecutorService _createExecutorService() {
        int producerConnections = Math.max(Integer.valueOf(
            _configuration.getValue(Property.KAFKA_PRODUCER_CONNECTIONS.getName(), Property.KAFKA_PRODUCER_CONNECTIONS.getDefaultValue())), 10);

        return Executors.newFixedThreadPool(producerConnections, new ThreadFactory() {

                AtomicInteger id = new AtomicInteger(0);

                @Override
                public Thread newThread(Runnable r) {
                    return new Thread(r, MessageFormat.format("kafka-producer-worker-{0}", id.getAndIncrement()));
                }
            });
    }
1053197
private static DisruptorEventQueue create() {
    // Create new Disruptor for processing. Note that Disruptor creates a single thread per
    // consumer (see https://github.com/LMAX-Exchange/disruptor/issues/121 for details);
    // this ensures that the event handler can take unsynchronized actions whenever possible.
    Disruptor<DisruptorEvent> disruptor =
        new Disruptor<>(
            DisruptorEventFactory.INSTANCE,
            DISRUPTOR_BUFFER_SIZE,
            new DaemonThreadFactory("OpenCensus.Disruptor"),
            ProducerType.MULTI,
            new SleepingWaitStrategy(0, 1000 * 1000));
    disruptor.handleEventsWith(new DisruptorEventHandler[] {DisruptorEventHandler.INSTANCE});
    disruptor.start();
    final RingBuffer<DisruptorEvent> ringBuffer = disruptor.getRingBuffer();

    DisruptorEnqueuer enqueuer =
        new DisruptorEnqueuer() {
          @Override
          public void enqueue(Entry entry) {
            long sequence = ringBuffer.next();
            try {
              DisruptorEvent event = ringBuffer.get(sequence);
              event.setEntry(entry);
            } finally {
              ringBuffer.publish(sequence);
            }
          }
        };
    return new DisruptorEventQueue(disruptor, enqueuer);
  }
412758
def start(self):
        """"""
        if self._state == CLOSED:
            raise NSQException('producer already closed')

        if self.is_running:
            self.logger.warn('producer already started')
            return

        self.logger.debug('starting producer...')
        self._state = RUNNING

        for address in self.nsqd_tcp_addresses:
            address, port = address.split(':')
            self.connect_to_nsqd(address, int(port))