@param $consumerTag
@param $nowait

@return \AMQP\Wire\Writer
183356
public function basicCancel($consumerTag, $nowait)
    {
        $args = new Writer();
        $args->writeShortStr($consumerTag)
            ->writeBit($nowait);
        return $args;
    }
152842
public function confirm_select($nowait = false)
    {
        list($class_id, $method_id, $args) = $this->protocolWriter->confirmSelect($nowait);

        $this->send_method_frame(array($class_id, $method_id), $args);

        if ($nowait) {
            return null;
        }

        $this->wait(array(
            $this->waitHelper->get_wait('confirm.select_ok')
        ), false, $this->channel_rpc_timeout);
        $this->next_delivery_tag = 1;
    }
481728
public function newInstance(
        string $createdByUserId,
        string $createdReason = Tracking::UNKNOWN_REASON
    ) {
        /** @var ContainerInterface|ContainerAbstract $new */
        $new = parent::newInstance(
            $createdByUserId,
            $createdReason
        );

        $new->lastPublished = new \DateTime();

        $new->revisions = new ArrayCollection();

        if (!empty($new->publishedRevision)) {
            $revision = $new->publishedRevision->newInstance(
                $createdByUserId,
                $createdReason
            );
            $new->removePublishedRevision();
            $new->revisions->add($revision);
            $new->setStagedRevision($revision);
        } elseif (!empty($new->stagedRevision)) {
            $revision = $new->stagedRevision->newInstance(
                $createdByUserId,
                $createdReason
            );
            $new->setStagedRevision($revision);
            $new->revisions->add($revision);
        }

        return $new;
    }
894829
protected function createDirectConsume(AMQPChannel $channel, $queue, $prefetch_count = 2, $global = false, $exchange = null, $consumerTag = null)
    {
        if ($exchange == null) {
            $exchange = create_uuid('route');
        }
        if ($consumerTag == null) {
            $consumerTag = create_uuid('consumer');
        }
        $channel->queue_declare($queue, true);
        $channel->exchange_declare($exchange, 'direct');
        $channel->queue_bind($queue, $exchange);
        $channel->basic_qos(0, $prefetch_count, $global);
        $channel->basic_consume($queue, $consumerTag, false, false, false, false, [$this, '_process_message']);
    }
435322
public static function createFrom(
        Storage $persistenceProvider,
        Storage $cacheProvider,
        LoggerInterface $logger = null
    ) {
        /** @var $userAgentHandlerChain \Wurfl\Handlers\Chain\UserAgentHandlerChain */
        $userAgentHandlerChain = $cacheProvider->load('UserAgentHandlerChain');

        if (!($userAgentHandlerChain instanceof UserAgentHandlerChain)) {
            $userAgentHandlerChain = self::init();
            $cacheProvider->save('UserAgentHandlerChain', $userAgentHandlerChain, 3600);
        }

        $userAgentHandlerChain->setLogger($logger);

        foreach ($userAgentHandlerChain->getHandlers() as $handler) {
            /* @var $handler \Wurfl\Handlers\AbstractHandler */
            $handler
                ->setLogger($logger)
                ->setPersistenceProvider($persistenceProvider);
        }

        return $userAgentHandlerChain;
    }
594344
public function cancel($consumerTag, $nowait = false)
    {
        $response = $this->cancelImpl($consumerTag, $nowait);
        unset($this->deliverCallbacks[$consumerTag]);
        return $response;
    }
416677
private final void _xmlWriteRawOn(FormattedWriter writer, boolean callBackToItem) throws IOException
    {
        new RawDataDumper(_persistentMessageStore, writer, callBackToItem).dump();
    }
650495
def write_nowait(self, item):
        
        self._queue.put_nowait(item)
        self._can_read.set()

        if self._queue.full():
            self._can_write.clear()
1068041
String writeDocument(Meter meter, Consumer<StringBuilder> consumer) {
        StringBuilder sb = new StringBuilder(indexLine);
        String timestamp = TIMESTAMP_FORMATTER.format(Instant.ofEpochMilli(config().clock().wallTime()));
        String name = getConventionName(meter.getId());
        String type = meter.getId().getType().toString().toLowerCase();
        sb.append("{\"").append(config.timestampFieldName()).append("\":\"").append(timestamp).append('"')
                .append(",\"name\":\"").append(escapeJson(name)).append('"')
                .append(",\"type\":\"").append(type).append('"');

        List<Tag> tags = getConventionTags(meter.getId());
        for (Tag tag : tags) {
            sb.append(",\"").append(escapeJson(tag.getKey())).append("\":\"")
                    .append(escapeJson(tag.getValue())).append('"');
        }

        consumer.accept(sb);
        sb.append("}");

        return sb.toString();
    }
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];
    }
732243
public function basicConsume($options)
    {
        $args = new Writer();
        $args->writeShort($options['ticket'])
            ->writeShortStr($options['queue'])
            ->writeShortStr($options['consumer_tag'])
            ->writeBit($options['no_local'])
            ->writeBit($options['no_ack'])
            ->writeBit($options['exclusive'])
            ->writeBit($options['no_wait']);
        return $args;
    }
1308164
private function get_consumer($request)
    {
        $consumer_key = $request instanceof Twitter_OAuthRequest
            ? $request->get_parameter('oauth_consumer_key')
            : null;

        if (!$consumer_key) {
            throw new Twitter_OAuthException('Invalid consumer key');
        }

        $consumer = $this->data_store->lookup_consumer($consumer_key);
        if (!$consumer) {
            throw new Twitter_OAuthException('Invalid consumer');
        }

        return $consumer;
    }
1089876
public function expectImplicit($expectedTag = null): ImplicitTagging
    {
        $el = $this;
        if (!$el instanceof ImplicitTagging) {
            throw new \UnexpectedValueException(
                "Element doesn't implement implicit tagging.");
        }
        if (isset($expectedTag)) {
            $el->expectTagged($expectedTag);
        }
        return $el;
    }
1093429
public function queuePurge($queue = '', $nowait = false)
    {
        return $this->getClient()->queuePurge($this->getChannelId(), $queue, $nowait);
    }
1181995
public function exchangeBind($destination, $source, $routingKey = '', $nowait = false, $arguments = [])
    {
        return $this->getClient()->exchangeBind($this->getChannelId(), $destination, $source, $routingKey, $nowait, $arguments);
    }
706229
@Override
    public final XMLEvent nextTag() throws XMLStreamException {
        XMLEvent event = this.nextEvent();
        while ((event.isCharacters() && event.asCharacters().isWhiteSpace())
                || event.isProcessingInstruction()
                || event.getEventType() == XMLStreamConstants.COMMENT) {

            event = this.nextEvent();
        }

        if (!event.isStartElement() && event.isEndElement()) {
            throw new XMLStreamException(
                    "Unexpected event type '"
                            + XMLStreamConstantsUtils.getEventName(event.getEventType())
                            + "' encountered. Found event: "
                            + event,
                    event.getLocation());
        }

        return event;
    }
24156
public function setCurrentFormat($currentFormat) {
        $allowedFormats = $this->getAllowedFormats();
        if(!in_array($currentFormat, $allowedFormats)) {
            throw new InvalidArgumentException('Invalid Date Format: ' . $currentFormat . ', expected: ' . implode(', ', $allowedFormats));
        }

        $allFormats = $this->getPreviousFormats();
        $allFormats[] = $this->getCurrentFormat();
        $this->setPreviousFormats($allFormats);

        $this->currentFormat = $currentFormat;
    }