Send a batch of LRS statements. MUST BE SCHEDULED! Failure to properly configure this class
will result in memory leaks.
516872
public void sendBatch() {
        LrsStatement statement = null;
        List<LrsStatement> list = new ArrayList<LrsStatement>();

        while ((statement = statementQueue.poll()) != null) {
            list.add(statement);
        }

        if (!list.isEmpty()) {
            postStatementList(list);
        }
    }
608372
public void sendData(KNXAddress addr, Priority p, byte[] tsdu)
		throws KNXTimeoutException, KNXLinkClosedException
	{
		if (detached)
			throw new KNXIllegalStateException("TL detached");
		tsdu[0] &= 0x03;
		lnk.sendRequestWait(addr, p, tsdu);
	}
373833
def _check_send_batch(self, result=None):
        
        if (
            (self.batch_every_n and self.batch_every_n <= self._waitingMsgCount) or
            (self.batch_every_b and self.batch_every_b <= self._waitingByteCount)
        ):
            self._send_batch()
        return result
492962
@Override
    protected void sendMessage(@NonNull INDArray message, int iterationNumber, int epochNumber) {
        // here we'll send our stuff to other executores over the wire
        // and let's pray for udp broadcast availability

        // Send this message away
        // FIXME: do something with unsafe duplication, which is bad and used ONLY for local spark
        try (MemoryWorkspace wsO = Nd4j.getMemoryManager().scopeOutOfWorkspaces()) {
            long updateId = updatesCounter.getAndIncrement();

            val m = message.unsafeDuplication();
            ModelParameterServer.getInstance().sendUpdate(m, iterationNumber, epochNumber);
        }


        // heere we update local queue
        super.sendMessage(message, iterationNumber, epochNumber);
    }
716239
def batch(self, queries):
        
        with self.connection() as cur:
            for sql, vars in queries:

                if self.debug:
                    print(cur.mogrify(query, vars))
                cur.execute(sql, vars)
96696
def send(self):
        
        from neobolt.exceptions import ConnectionExpired
        if self._connection:
            try:
                self._connection.send()
            except ConnectionExpired as error:
                raise SessionExpired(*error.args)
1029164
async def _send_loop(self):
        
        while self._user_connected and not self._reconnecting:
            if self._pending_ack:
                ack = RequestState(MsgsAck(list(self._pending_ack)), self._loop)
                self._send_queue.append(ack)
                self._last_acks.append(ack)
                self._pending_ack.clear()

            self._log.debug('Waiting for messages to send...')
            # TODO Wait for the connection send queue to be empty?
            # This means that while it's not empty we can wait for
            # more messages to be added to the send queue.
            batch, data = await self._send_queue.get()

            if not data:
                continue

            self._log.debug('Encrypting %d message(s) in %d bytes for sending',
                          len(batch), len(data))

            data = self._state.encrypt_message_data(data)
            try:
                await self._connection.send(data)
            except IOError as e:
                self._log.info('Connection closed while sending data')
                self._start_reconnect(e)
                return

            for state in batch:
                if not isinstance(state, list):
                    if isinstance(state.request, TLRequest):
                        self._pending_state[state.msg_id] = state
                else:
                    for s in state:
                        if isinstance(s.request, TLRequest):
                            self._pending_state[s.msg_id] = s

            self._log.debug('Encrypted messages put in a queue to be sent')
1217257
def send(self, msg, error_check=False):
        
        with self.lock:
            msg = msg.replace('\r', '\\r').replace('\n', '\\n') + self._crlf
            try:
                data = msg.encode(self.encoding)
            except UnicodeEncodeError:
                data = msg.encode(self.fallback_encoding)
            if len(data) > 512:
                raise self.MessageTooLong("LurklibError: MessageTooLong")
            self._socket.send(data)
            if error_check and self.readable():
                self._recv()
                self.stepback()
387612
protected void sendRequests() {
        if ( ! requestUnderway ) {
            requestUnderway = true;
            delayed( new Runnable() {
                @Override
                public void run() {
                    synchronized (requests) {
                        Object req[];
                        if ( openFutureRequests.get() > 0 && requests.size() == 0 ) {
                            req = new Object[] { "SP", lastSeenSeq };
                        } else {
                            req = new Object[requests.size() + 1];
                            for (int i = 0; i < requests.size(); i++) {
                                req[i] = requests.get(i);
                            }
                            req[req.length - 1] = lastSeenSeq;
                            requests.clear();
                        }

                        sendCallArray(req).then(new Callback<Integer>() {
                            @Override
                            public void receive(Integer result, Object error) {
                                synchronized (requests ) {
                                    requestUnderway = false;
                                    if ( requests.size() > 0 || (result != null && result > 0 && openFutureRequests.get() > 0 ) ) {
                                        myExec.execute(new Runnable() {
                                            @Override
                                            public void run() {
                                            sendRequests();
                                            }
                                        });
                                    }
                                }
                            }
                        });
                    }
                }
            }, 1);
        }
    }
1260101
private void scheduleLoadTicks() {
        Runnable sendLoadToZookeeper = new Runnable() {
            @Override
            public void run() {
                final List<String> loads = new ArrayList<String>();
                synchronized (meters) {
                    for (Map.Entry<String,Meter> entry : meters.entrySet()) {
                        final String workUnit = entry.getKey();
                        loads.add(String.format("/%s/meta/workload/%s", cluster.name, workUnit));
                        loads.add(String.valueOf(entry.getValue().getOneMinuteRate()));
                    }
                }

                Iterator<String> it = loads.iterator();
                while (it.hasNext()) {
                    final String path = it.next();
                    final String rate = it.next();
                    try {
                        ZKUtils.setOrCreate(cluster.zk, path, rate, CreateMode.PERSISTENT);
                    } catch (Exception e) {
                        // should we fail the loop too?
                        LOG.error("Problems trying to store load rate for {} (value {}): ({}) {}",
                                path, rate, e.getClass().getName(), e.getMessage());
                    }
                }

                String nodeLoadPath = String.format("/%s/nodes/%s", cluster.name, cluster.myNodeID);
                try {
                    NodeInfo myInfo = new NodeInfo(cluster.getState().toString(), cluster.zk.get().getSessionId());
                    byte[] myInfoEncoded = JsonUtil.asJSONBytes(myInfo);
                    ZKUtils.setOrCreate(cluster.zk, nodeLoadPath, myInfoEncoded, CreateMode.EPHEMERAL);
                    if (LOG.isDebugEnabled()) {
                        // TODO: Shouldn't be evaluating methods inside of a logging statement.
                        LOG.debug("My load: {}", myLoad());
                    }
                } catch (Exception e) {
                    LOG.error("Error reporting load info to ZooKeeper.", e);
                }
            }
        };

        loadFuture = cluster.scheduleAtFixedRate(sendLoadToZookeeper, 0, 1, TimeUnit.MINUTES);
    }
1055300
void sendDeltaWorkSuccessful()
   {
      successful.incrementAndGet();

      if (trace)
         log.tracef("sendDeltaWorkSuccessful: %s", workManagers);

      if (own != null && transport != null && transport.isInitialized())
      {
         for (Address address : workManagers)
         {
            if (!own.equals(address))
               transport.deltaWorkSuccessful(address);
         }
      }
   }
812300
def normalize_block
      statements = value.to_vool
      index = statements.length - 1
      snd = statements.statements[index]
      raise "Expecting Send #{snd.class}:#{snd}" unless snd.is_a?( Vool::SendStatement)
      statements.statements[index] = assignment( snd )
      statements
    end
541881
@Override
    public boolean sendEvent(LrsStatement statement) {
        if (!isEnabled()) {
            return false;
        }

        ResponseEntity<Object> response =
                sendRequest(
                        STATEMENTS_REST_ENDPOINT, HttpMethod.POST, null, statement, Object.class);
        if (response.getStatusCode().series() == Series.SUCCESSFUL) {
            logger.trace("LRS provider successfully sent to {}, statement: {}", LRSUrl, statement);
        } else {
            logger.error("LRS provider failed to send to {}, statement: {}", LRSUrl, statement);
            logger.error("- Response: {}", response);
            return false;
        }

        return true;
    }
1143054
def send(self, *args):
        
        # this and the serializer could use some streamlining
        if None in args:
            raise TypeError('None is not a valid queue item.')
        serialized_values = [self.serialize(value) for value in args]
        logger.debug('Sending to "%s": %s', self.name, serialized_values)
        return self.redis.rpush(self.name, *serialized_values)
1337880
public void send(ByteArrayOutputStream bos) {
    try {
      if (this.isDisabled) {
        return;
      }
      if (available.tryAcquire(WAIT_NEXT_BUFFER_TIME_OUT_SECONDS, TimeUnit.SECONDS)) {
        tasks.add(sendExecutor.submit(new SendWorker(bos, segmentId++, false)));
      } else {
        setErrorStatus("Number of chunks in the queue to be send exceeded the configured number " 
             + maxBufferedChunks, null);
      }
    } catch (Exception e) {
      setErrorStatus("Exception when submitting a task", e);
    }
  }
667566
function sendRequestPreExec(statementContext, onResultAvailable)
{
  // get the request headers
  var headers = statementContext.resultRequestHeaders;

  // build the basic json for the request
  var json =
  {
    disableOfflineChunks : false,
    sqlText              : statementContext.sqlText
  };

  // if binds are specified, build a binds map and include it in the request
  if (Util.exists(statementContext.binds))
  {
    json.bindings = buildBindsMap(statementContext.binds);
  }

  // include statement parameters if a value was specified
  if (Util.exists(statementContext.parameters))
  {
    json.parameters = statementContext.parameters;
  }

  // include the internal flag if a value was specified
  if (Util.exists(statementContext.internal))
  {
    json.isInternal = statementContext.internal;
  }

  // use the snowflake service to issue the request
  sendSfRequest(statementContext,
  {
    method  : 'POST',
    headers : headers,
    url     : Url.format(
    {
      pathname : '/queries/v1/query-request',
      search   : QueryString.stringify(
      {
        requestId: statementContext.requestId
      })
    }),
    json: json,
    callback: buildResultRequestCallback(
        statementContext, headers, onResultAvailable)
  },
  true);
}
567068
def sendall(self, data, **kws):
        """"""
        return SendAll(self, data, timeout=self._timeout, **kws)