Sends a shutdown message to other workers.
424792
def shutdown(self):
        """"""
        if self.ZMQcontext and not self.ZMQcontext.closed:
            scoop.SHUTDOWN_REQUESTED = True
            self.socket.send(SHUTDOWN)
            
            # pyzmq would issue an 'no module named zmqerror' on windows
            # without this
            try:
                self.direct_socket.__del__()
                self.socket.__del__()
                self.infoSocket.__del__()
            except AttributeError:
                # Older versions of pyzmq doesn't have the __del__ method
                pass

            self.ZMQcontext.destroy()
761547
async def shutdown(self):
        

        if self.log_output:
            logging.info('Shutting down ...')
        else:
            print('Shutting down ...')

        await self.send_reset()

        try:
            self.loop.stop()
        except:
            pass
        try:
            self.loop.close()
        except:
            pass
        sys.exit(0)
1282358
def close(self):
        
        if self.is_worker():
            return

        for worker in self.workers:
            self.comm.send(None, worker, 0)
445377
public void shutdown() {
	    if (shutdown) 
	    {
	        return;
	    }
	    shutdown = true;
	    synchronized (workers) 
	    {
	        for (int i = workers.size(); i > 0; i--) 
	        {
	        	systemExecute(exitTask);
	        }
	        waitConditionStrategy.signalAllWhenBlocking();
	    }
	}
390222
public void awaitShutdown() throws InterruptedException {
        synchronized (lock) {
            if (!shutdown) {
                throw UndertowMessages.MESSAGES.handlerNotShutdown();
            }
            while (activeRequestsUpdater.get(this) > 0) {
                lock.wait();
            }
        }
    }
553624
synchronized public void shutdown()
    {
        m_shutdown.set(true);
        if (m_isExecutorServiceLocal) {
            try {
                m_es.shutdown();
                m_es.awaitTermination(365, TimeUnit.DAYS);
            } catch (InterruptedException e) {
                repairLog.warn("Unexpected interrupted exception", e);
            }
        }
    }
478239
def on_shutdown(self, broker):
        """"""
        _v and LOG.debug('%r.on_shutdown(%r)', self, broker)
        fire(self, 'shutdown')
        for handle, (persist, fn) in self._handle_map.iteritems():
            _v and LOG.debug('%r.on_shutdown(): killing %r: %r', self, handle, fn)
            fn(Message.dead(self.broker_shutdown_msg))
202799
public void shutdown() {
    gossipServiceRunning.set(false);
    gossipThreadExecutor.shutdown();
    if (passiveGossipThread != null) {
      passiveGossipThread.shutdown();
    }
    if (activeGossipThread != null) {
      activeGossipThread.shutdown();
    }
    try {
      boolean result = gossipThreadExecutor.awaitTermination(1000, TimeUnit.MILLISECONDS);
      if (!result) {
        LOGGER.error("executor shutdown timed out");
      }
    } catch (InterruptedException e) {
      LOGGER.error(e);
    }
  }
466120
@CommandArgument
  public void stop() {
    System.out.println("Stopping worker");
    worker.shutdown();
    workerThread.interrupt();
    try {
      workerThread.join();
    } catch (InterruptedException e) {
      logger.warn("Joining to worker thread interrupted", e);
    }
    worker = null;
    workerThread = null;
    taskProgressStates = null;
  }
1004052
def shutdown_consumers(num_workers=2,
                       tasks=None,
                       shutdown_msg="SHUTDOWN"):
    
    if tasks:
        # Add a poison pill for each consumer
        for i in range(num_workers):
            tasks.put(shutdown_msg)
138228
public function shutdown() {
        if (($error = error_get_last())) {
            ob_clean();
            /* log error */
            $msg = $error["message"] . " in file: " . $error["file"] . " on line: " . $error["line"];
            $log = new Logger('kernel');
            $file = self::get("dir", "log") . "/log-" . date("Ymd") . ".log";
            $log->pushHandler(new StreamHandler($file, Logger::ERROR));
            switch ($this->mode) {
                case self::$MODE_PRODUCTION:
                    $log->addError($msg);
                    $request = new HttpRequest();
                    $class = self::get("defaultController");
                    $method = self::get("errorMethod");
                    $controller = new $class();
                    $this->dispatch($controller, $method, $request);
                    break;
                case self::$MODE_DEVELOPMENT:
                    die($msg);
                    break;

                default:
                    echo $msg;
                    break;
            }
        }
    }
335714
protected function shutdownWorkers()
    {
        $workers = Resque_Worker::all();

        foreach ($workers as $worker) {
            list($name, $pid, $queues) = explode(':', (string) $worker);
            posix_kill((int) $pid, SIGQUIT);
        }

        $this->output->writeln('<info>SIGQUIT sent to '.count($workers).' workers.</info>');
    }
460774
@Override
  public void shutdown() throws InterruptedException {
    try {
      channel.close();
      for(Map.Entry<String, Sender> entry: senders.entrySet()) {
        entry.getValue().shutdown();
      }
      senders.clear();

      for(Map.Entry<String, ChannelHandlerContext> entry:
          receivers.entrySet()) {
        entry.getValue().close();
      }
      receivers.clear();

    } finally {
      try {
        long quietPeriodSec = 0;
        long timeoutSec = 10;
        io.netty.util.concurrent.Future wf =
          workerGroup.shutdownGracefully(quietPeriodSec, timeoutSec,
                                         TimeUnit.SECONDS);
        io.netty.util.concurrent.Future bf =
          bossGroup.shutdownGracefully(quietPeriodSec, timeoutSec,
                                       TimeUnit.SECONDS);
        wf.await();
        bf.await();
        LOG.debug("Shutdown complete: {}", hostPort);
      } catch (InterruptedException ex) {
        LOG.debug("Interrupted while shutting down NioEventLoopGroup", ex);
      }
    }
  }
500073
public static function shutdown()
    {
        self::$msgOutputLevel = Project::MSG_INFO;
        self::restoreIni();
        self::getTimer()->stop();
    }
342982
def on_shutdown(self, broker):
        """"""
        LOG.debug('%r closing CALL_FUNCTION channel', self)
        self._send(
            mitogen.core.Message(
                src_id=mitogen.context_id,
                dst_id=self.remote_id,
                handle=mitogen.core.SHUTDOWN,
            )
        )
376300
def send_command(self, command):
        """"""
        if self._pipe_commands:
            self._pipe_commands.send(command)
        else:
            if self.shutdown:
                # Stop delivering messages in shutdown.
                self.log.info(
                    "During shutdown no command queue pipe found for command\n%s",
                    str(command),
                )
            else:
                self.log.error(
                    "No command queue pipe found for command\n%s", str(command)
                )
1350461
public synchronized void shutDown() {

        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(
                org.opencms.main.Messages.get().getBundle().key(
                    org.opencms.main.Messages.INIT_SHUTDOWN_START_1,
                    this.getClass().getName()));
        }

        // prevent new publish jobs are accepted
        m_shuttingDown = true;

        // if a job is currently running,
        // wait the specified amount of time,
        // then write an abort message to the report
        if (m_currentPublishThread != null) {

            // if a shutdown time is defined, wait  if a publish process is running
            if (m_publishQueueShutdowntime > 0) {
                synchronized (this) {
                    try {
                        Thread.sleep(m_publishQueueShutdowntime * 1000);
                    } catch (InterruptedException exc) {
                        // ignore
                    }
                }
            }

            if (m_currentPublishThread != null) {
                CmsPublishJobInfoBean publishJob = m_currentPublishThread.getPublishJob();
                try {
                    abortPublishJob(m_adminUserId, new CmsPublishJobEnqueued(publishJob), false);
                } catch (CmsException e) {
                    if (LOG.isErrorEnabled()) {
                        LOG.error(e.getLocalizedMessage(), e);
                    }
                }
            }
        }

        // write the log
        CmsDbContext dbc = getDbContext(null);
        try {
            m_driverManager.updateLog(dbc);
        } catch (CmsDataAccessException e) {
            if (LOG.isErrorEnabled()) {
                LOG.error(e.getLocalizedMessage(), e);
            }
        } finally {
            dbc.clear();
        }

        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(
                org.opencms.staticexport.Messages.get().getBundle().key(
                    org.opencms.staticexport.Messages.INIT_SHUTDOWN_1,
                    this.getClass().getName()));
        }
    }