Send the daemon status and the current queue for displaying.
174174
def send_status(self, payload):
        """"""
        answer = {}
        data = []
        # Get daemon status
        if self.paused:
            answer['status'] = 'paused'
        else:
            answer['status'] = 'running'

        # Add current queue or a message, that queue is empty
        if len(self.queue) > 0:
            data = deepcopy(self.queue.queue)
            # Remove stderr and stdout output for transfer
            # Some outputs are way to big for the socket buffer
            # and this is not needed by the client
            for key, item in data.items():
                if 'stderr' in item:
                    del item['stderr']
                if 'stdout' in item:
                    del item['stdout']
        else:
            data = 'Queue is empty'
        answer['data'] = data

        return answer
822818
async def send_frame(self, frame):
        """"""
        if not self.connection.connected:
            await self.connect()
            await self.update_version()
            await set_utc(pyvlx=self)
            await house_status_monitor_enable(pyvlx=self)
        self.connection.write(frame)
689530
def showStatus(self, msg):
        
        log.debug(msg)
        self.statusBar().showMessage(msg)
547096
def status(queue, munin, munin_config):
    """"""
    if munin_config:
        return status_print_config(queue)
    queues = get_queues(queue)
    for queue in queues:
        status_print_queue(queue, munin=munin)
    if not munin:
        print('-' * 40)
213259
def serve(self):
        """"""
        while self.ready:
            try:
                self.tick()
            except (KeyboardInterrupt, SystemExit):
                raise
            except Exception:
                self.error_log(
                    'Error in HTTPServer.tick', level=logging.ERROR,
                    traceback=True,
                )

            if self.interrupt:
                while self.interrupt is True:
                    # Wait for self.stop() to complete. See _set_interrupt.
                    time.sleep(0.1)
                if self.interrupt:
                    raise self.interrupt
108906
def run(self):
        
        while True:
            msg = self._queue.get()
            if msg is _SHUTDOWN:
                break
            if self._enabled:
                print msg
169441
def send_jsonified(self, msg, stats=True):
        
        msg = bytes_to_str(msg)

        if self._immediate_flush:
            if self.handler and self.handler.active and not self.send_queue:
                # Send message right away
                self.handler.send_pack('a[%s]' % msg)
            else:
                if self.send_queue:
                    self.send_queue += ','
                self.send_queue += msg

                self.flush()
        else:
            if self.send_queue:
                self.send_queue += ','
            self.send_queue += msg

            if not self._pending_flush:
                self.server.io_loop.add_callback(self.flush)
                self._pending_flush = True

        if stats:
            self.stats.on_pack_sent(1)
297966
public void prepareStatus() {
        globalLineCounter = new AtomicLong(0);
        time = new AtomicLong(System.currentTimeMillis());
        startTime = System.currentTimeMillis();
        lastCount = 0;

        // Status thread regularly reports on what is happening
        Thread statusThread = new Thread() {
            public void run() {
                while (true) {
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        System.out.println("Status thread interrupted");
                    }

                    long thisTime = System.currentTimeMillis();
                    long currentCount = globalLineCounter.get();

                    if (thisTime - time.get() > 1000) {
                        long oldTime = time.get();
                        time.set(thisTime);
                        double avgRate = 1000.0 * currentCount / (thisTime - startTime);
                        double instRate = 1000.0 * (currentCount - lastCount) / (thisTime - oldTime);
                        lastCount = currentCount;
                        System.out.println(currentCount + " AvgRage:" + ((int) avgRate) + " lines/sec  instRate:"
                                + ((int) instRate) + " lines/sec  Unassigned Work: "
                                + remainingBlocks.get() + " blocks");
                    }
                }
            }
        };
        statusThread.start();
    }
368448
def _StatusUpdateThreadMain(self):
    """"""
    while self._status_update_active:
      # Make a local copy of the PIDs in case the dict is changed by
      # the main thread.
      for pid in list(self._process_information_per_pid.keys()):
        self._CheckStatusAnalysisProcess(pid)

      self._UpdateForemanProcessStatus()

      if self._status_update_callback:
        self._status_update_callback(self._processing_status)

      time.sleep(self._STATUS_UPDATE_INTERVAL)
227952
private function sendStatus()
    {
        if (headers_sent()) return;

        if (isset($this->status_messages[$this->status])) {
            header(sprintf('HTTP/%s %d %s', $this->request->getHttpVersion(), $this->status, $this->status_messages[$this->status]));
        } else {
            header('Status: ' . $this->status);
        }
    }
325572
def QueueResponse(self, message, blocking=True):
    """"""
    self._out_queue.Put(message, block=blocking)
45827
async def send(self, pkt):
        """"""
        if not await self.check_ping_timeout():
            return
        if self.upgrading:
            self.packet_backlog.append(pkt)
        else:
            await self.queue.put(pkt)
        self.server.logger.info('%s: Sending packet %s data %s',
                                self.sid, packet.packet_names[pkt.packet_type],
                                pkt.data if not isinstance(pkt.data, bytes)
                                else '<binary>')
1089288
def update_status sig=0
      pid_int = Integer("#{ @pid }")
      begin
        Process::kill sig, pid_int
        true
      rescue Errno::ESRCH
        false
      end
    end
360682
def flush(self):
        """"""
        self._pending_flush = False

        if self.handler is None or not self.handler.active or not self.send_queue:
            return

        self.handler.send_pack('a[%s]' % self.send_queue)
        self.send_queue = ''
320936
def send_emission(self):
        
        if self._emit_queue.empty():
            return
        emit = self._emit_queue.get()
        emit()
88412
def do_status(self, service):
        
        if service:
            self.do_show("services", single=service)
        else:
            self.do_show("services")
358807
def _sendQueued(self):
        """"""
        for tReq in list(self.requests.values()):  # must copy, may del
            if not tReq.sent:
                self._sendRequest(tReq)