-- pump messages on a producer
979771
function pump(p) {
  function push() {
    ++totalPushed;
    sendMessage(p, config.message);
    setTimeout(push,0);
  }
  push();
}
144329
def _message(self, bus, message):
        
        if not self.finished:
            if message.type == Gst.MessageType.EOS:
                # The file is done. Tell the consumer thread.
                self.queue.put(SENTINEL)
                if not self.got_caps:
                    # If the stream ends before _notify_caps was called, this
                    # is an invalid file.
                    self.read_exc = NoStreamError()
                    self.ready_sem.release()

            elif message.type == Gst.MessageType.ERROR:
                gerror, debug = message.parse_error()
                if 'not-linked' in debug:
                    self.read_exc = NoStreamError()
                elif 'No such file' in debug:
                    self.read_exc = IOError('resource not found')
                else:
                    self.read_exc = FileReadError(debug)
                self.ready_sem.release()
624897
public KafkaMessage sendMessage(ProducerType type, KafkaMessage message) {
        String key = message.key();
        ProducerRecord<String, byte[]> record = StringUtils.isEmpty(key)
                ? new ProducerRecord<>(message.topic(), message.content())
                : new ProducerRecord<>(message.topic(), key, message.content());
        KafkaProducer<String, byte[]> producer = getJavaProducer(type);
        try {
            RecordMetadata metadata = producer.send(record).get();
            KafkaMessage kafkaMessage = new KafkaMessage(message);
            kafkaMessage.partition(metadata.partition());
            kafkaMessage.offset(metadata.offset());
            return kafkaMessage;
        } catch (InterruptedException | ExecutionException e) {
            throw new KafkaException(e);
        }
    }
46748
async def run(self):
        
        # Implement pull max batch from queue instead of one message at a time
        while self.eh_partition_pump.pump_status != "Errored" and not self.eh_partition_pump.is_closing():
            if self.eh_partition_pump.partition_receive_handler:
                try:
                    msgs = await self.eh_partition_pump.partition_receive_handler.receive(
                        max_batch_size=self.max_batch_size,
                        timeout=self.recieve_timeout)
                except Exception as e:  # pylint: disable=broad-except
                    _logger.info("Error raised while attempting to receive messages: %r", e)
                    await self.process_error_async(e)
                else:
                    if not msgs:
                        _logger.info("No events received, queue size %r, release %r",
                                     self.eh_partition_pump.partition_receive_handler.queue_size,
                                     self.eh_partition_pump.host.eph_options.release_pump_on_timeout)
                        if self.eh_partition_pump.host.eph_options.release_pump_on_timeout:
                            await self.process_error_async(TimeoutError("No events received"))
                    else:
                        await self.process_events_async(msgs)
495660
private void sendUsingProducerSession(Message message) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "sendUsingProducerSession", new Object[] { message });

        checkClosed();
        // check for sync/async conflicts
        session.checkSynchronousUsage("send");
        // if the supplied message is null, throw a jms MessageFormatException.
        if (message == null) {
            throw (MessageFormatException) JmsErrorUtils.newThrowable(
                                                                      MessageFormatException.class,
                                                                      "INVALID_VALUE_CWSIA0068",
                                                                      new Object[] { "message", null },
                                                                      tc);
        }
        if (propsOverriden) {
            // This block will be invoked if the user is flipping back and forth
            // between the multi-arg identified send, and this 1-arg send. In this
            // case we need to re-instate the dm, pri, ttl values from the producer.
            producerProperties.setInDeliveryMode(defaultDeliveryMode);
            producerProperties.setInPriority(defaultPriority);
            producerProperties.setInTTL(defaultTimeToLive);

            // Mark that we are back with the defaults so we don't do this set the
            // next time around.
            propsOverriden = false;
        }

        // Delegate to the internal send method.
        sendMessage(producerProperties, message, dest);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "sendUsingProducerSession");

    }
447913
def _notify_caps(self, pad, args):
        
        # The sink has started to receive data, so the stream is ready.
        # This also is our opportunity to read information about the
        # stream.
        self.got_caps = True
        info = pad.get_current_caps().get_structure(0)

        # Stream attributes.
        self.channels = info.get_int('channels')[1]
        self.samplerate = info.get_int('rate')[1]

        # Query duration.
        success, length = pad.get_peer().query_duration(Gst.Format.TIME)
        if success:
            self.duration = length / 1000000000
        else:
            self.read_exc = MetadataMissingError('duration not available')

        # Allow constructor to complete.
        self.ready_sem.release()
932188
@Override
    public void sendSilenceMessage(
                                   long startStamp,
                                   long endStamp,
                                   long completedPrefix,
                                   boolean requestedOnly,
                                   int priority,
                                   Reliability reliability,
                                   SIBUuid12 stream)
    {
        // NOP, the PubSubInputHandler doesn't originate
        // silence.  The associated output handlers do it
        // for us.
    }
458295
private void createProcessOutputPump(InputStream is, OutputStream os) {
        outputThread = createPump(is, os, CLOSE_STDOUT_AND_STDERR_INSTREAMS_WHEN_EXHAUSTED);
    }
908819
def emit(self, record):
        
        if not record.name == "amqp":
            data = {}
            for k, v in record.__dict__.items():
                if (self.__includes and k in self.__includes) or (self.__excludes and k not in self.__excludes):
                    data[k] = v
            self.__producer.publish(data, retry=True, delivery_mode=2)
198053
protected void sendDatagram (UpstreamMessage msg)
        throws IOException
    {
        // reset the stream and write our connection id and hash placeholder
        _bout.reset();
        _uout.writeInt(_client.getConnectionId());
        _uout.writeLong(0L);

        // write the datagram through the sequencer
        _sequencer.writeDatagram(msg);

        // flip the buffer and make sure it's not too long
        ByteBuffer buf = _bout.flip();
        int size = buf.remaining();
        if (size > Client.MAX_DATAGRAM_SIZE) {
            log.warning("Dropping oversized datagram", "size", size, "msg", msg);
            return;
        }

        // compute the hash
        buf.position(12);
        _digest.update(buf);
        byte[] hash = _digest.digest(_secret);

        // insert the first 64 bits of the hash
        buf.position(4);
        buf.put(hash, 0, 8).rewind();

        // send the datagram
        writeDatagram(buf);

        // notify the tracker
        _client.getMessageTracker().messageSent(true, size, msg);
    }
256084
function broadcastMonitors(records, moduleId, msg) {
    msg = protocol.composeRequest(null, moduleId, msg);

    if (records instanceof Array) {
        for (let i = 0, l = records.length; i < l; i++) {
            const socket = records[i].socket;
            doSend(socket, 'monitor', msg);
        }
    } else {
        for (const id in records) {
            if (records.hasOwnProperty(id)) {
                const socket = records[id].socket;
                doSend(socket, 'monitor', msg);
            }
        }
    }
}
690676
private void actionWillProduce()
    {
        if (checker.checkProduction(current))
        {
            startProduction(current);
            state = ProducerState.PRODUCING;
        }
        else
        {
            for (final ProducerListener listener : listeners)
            {
                listener.notifyCanNotProduce(current);
            }
        }
    }
394260
@Override
    public void sendAckMessage(
                               SIBUuid8 upstream,
                               SIBUuid12 destUuid,
                               SIBUuid8 busUuid,
                               long ackPrefix,
                               int priority,
                               Reliability reliability,
                               SIBUuid12 stream,
                               boolean consolidate) throws SIResourceException, SIErrorException
    {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "sendAckMessage", new Long(ackPrefix));

        if (upstream == null)
        {
            upstream = _originStreamMap.get(stream);
        }

        ControlAck ackMsg = createControlAckMessage(priority, reliability, stream);

        ackMsg.setAckPrefix(ackPrefix);

        if ((consolidate) &&
            (_internalInputStreamManager.hasStream(stream, priority, reliability)))
        {
            try
            {
                processAck(ackMsg);
            } catch (SIResourceException e)
            {
                // FFDC
                FFDCFilter.processException(
                                            e,
                                            "com.ibm.ws.sib.processor.impl.PubSubInputHandler.sendAckMessage",
                                            "1:600:1.329.1.1",
                                            this);
            }
        }
        else
        {
            // Send this to MPIO
            // Send Ack messages at the priority of the original message +1
            _mpio.sendToMe(
                           upstream,
                           priority + 1,
                           ackMsg);

        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "sendAckMessage");
    }
1176619
public void pushMessages(List<byte[]> messages) {
    for (byte[] message: messages) {
      producer.send(new ProducerRecord<>(topic, message), (recordMetadata, e) -> {
        if (e != null) {
          log.error("Failed to send message to topic {} due to exception: ", topic, e);
        }
      });
    }
  }
286033
function BatchMessage(type) {
  this.type = type;
  this.queries = [];
  this.values = [];
  this.consistencyLevel = CONSISTENCY_LEVEL.ONE;
  Request.call(this, 0x0D);
}
1031925
def emit(self, record):
        """"""
        if self.triggerLevelNo is not None and record.levelno>=self.triggerLevelNo:
            self.triggered = True
        logging.handlers.BufferingHandler.emit(self,record)
294985
def message(self, executor_id, slave_id, message):
        
        logging.info('Sends message `{}` to executor `{}` on slave `{}`'.format(
                     message, executor_id, slave_id))
        return self.driver.sendFrameworkMessage(encode(executor_id),
                                                encode(slave_id),
                                                message)