Unregister this worker in Redis. (shutdown etc)
545120
public function unregisterWorker()
    {
        if(is_object($this->currentJob)) {
            $this->currentJob->fail(new DirtyExitException);
        }

        $id = (string)$this;
        Resque::redis()->srem('workers', $id);
        Resque::redis()->del('worker:' . $id);
        Resque::redis()->del('worker:' . $id . ':started');
        Stat::clear('processed:' . $id);
        Stat::clear('failed:' . $id);
    }
354447
public function unregister()
    {
        if ($this->child === 0) {
            // This is a child process so don't unregister worker
            // However if the shutdown was due to an error, for instance the job hitting the
            // max execution time, then catch the error and fail the job
            if (($error = error_get_last()) and in_array($error['type'], $this->shutdownErrors)) {
                $this->job->fail(new \ErrorException($error['message'], $error['type'], 0, $error['file'], $error['line']));
            }

            return;
        } elseif (!is_null($this->child)) {
            // There is a child process running
            $this->log('There is a child process pid:'.$this->child.' running, killing it', Logger::DEBUG);
            $this->killChild();
        }

        if (is_object($this->job)) {
            $this->job->fail(new Exception\Cancel);
            $this->log('Failing running job <pop>'.$this->job.'</pop>', Logger::NOTICE);
        }

        $this->log('Unregistering worker <pop>'.$this.'</pop>', Logger::NOTICE);

        $this->redis->srem(self::redisKey(), $this->id);
        $this->redis->expire(self::redisKey($this), \Resque::getConfig('default.expiry_time', \Resque::DEFAULT_EXPIRY_TIME));

        $this->host->finished($this);

        // Remove pid file if one set
        if (!is_null($this->pidFile) and getmypid() === (int)trim(file_get_contents($this->pidFile))) {
            unlink($this->pidFile);
        }

        Event::fire(Event::WORKER_UNREGISTER, $this);
    }
1061680
def unregister_all(self):
        
        aliases = list(self._service_objects.keys())
        for alias in aliases:
            self.unregister(alias)
647555
def unregisterAddon(cls, name):
        
        prop = '_{0}__addons'.format(cls.__name__)
        cmds = getattr(cls, prop, {})
        cmds.pop(name, None)
162715
def delete(self, redis):
        '''  '''
        value = getattr(self.obj, self.name)
        redis.srem(self.key() + ':' + value, self.obj.id)
344121
void unregistered() {
        try {
            if (!m_alreadyStopped) {
                try {
                    safeStopping();
                } finally {
                    try {
                        m_writeStream.shutdown();
                    } finally {
                        m_readStream.shutdown();
                    }
                }
            }
        } finally {
            networkLog.debug("Closing channel " + m_threadName);
            try {
                m_sc.close();
            } catch (IOException e) {
                networkLog.warn(e);
            }
        }
    }
1089596
def close
      if Native.inotify_rm_watch(@notifier.fd, @id) == 0
        @notifier.watchers.delete(@id)
        return
      end

      raise SystemCallError.new("Failed to stop watching #{path.inspect}",
                                FFI.errno)
    end
1065573
public static void unregister() {
    synchronized (monitor) {
      checkState(handler != null, "Zipkin exporter is not registered.");
      unregister(Tracing.getExportComponent().getSpanExporter());
      handler = null;
    }
  }
1021434
def unregisterHandler(self, fh):

        

        try:
            self.fds.remove(fh)

        except KeyError:
            pass

        self.lock.acquire()

        try:
            self.data.rollover() # rollover data on close.

        finally:
            self.lock.release()

        if self.closing and not self.fds:
            self.data.close()
727582
def shutdown(self):
        
        # Remove reference to inputQueue (raises exception if inputQueue is used after method call)
        inputQueue = self.inputQueue
        self.inputQueue = None
        for i in range(self.numWorkers):
            inputQueue.put(None)
        for thread in self.workerThreads:
            thread.join()
        BatchSystemSupport.workerCleanup(self.workerCleanupInfo)
475447
private synchronized void unregisterAllSimons() {
		Iterator<String> namesIter = registeredNames.iterator();
		while (namesIter.hasNext()) {
			String name = namesIter.next();
			try {
				ObjectName objectName = new ObjectName(name);
				mBeanServer.unregisterMBean(objectName);
				// I have to use iterator.remove() - hence no common method for clearManager() and simonDestroyed(simon)
				namesIter.remove();
				onManagerMessage("Unregistered Simon with the name: " + objectName);
			} catch (JMException e) {
				onManagerWarning("JMX unregistration failed for: " + name, e);
			}
		}
	}
798637
def UnregisterFlowProcessingHandler(self, timeout=None):
    """"""
    if self.flow_processing_request_handler_thread:
      self.flow_processing_request_handler_stop = True
      self.flow_processing_request_handler_thread.join(timeout)
      if self.flow_processing_request_handler_thread.isAlive():
        raise RuntimeError("Flow processing handler did not join in time.")
      self.flow_processing_request_handler_thread = None
1320401
def uninstall
      vm.Event[:unload].call(self.name)
      vm.Delayer.new do
        @events.map(&:detach)
        @filters.map(&:detach)
        self.class.destroy name
      end
      self end
1177613
public function unregister()
    {
        foreach (array_reverse($this->previousLoaders) as $previousLoader) {
            spl_autoload_register($previousLoader, true);
        }

        spl_autoload_unregister(array($this, 'loadClass'));
    }
1292356
def payload_unregister(klass, pid):
    
    cmd = ['payload-unregister']
    for x in [klass, pid]:
        cmd.append(x)
    subprocess.check_call(cmd)
1128109
def unregister(self, id):
        '''
        
        '''
        result = self.rr.table(self.table).get(id).delete().run()
        if result != {
                'deleted':1, 'errors':0,'inserted':0,
                'replaced':0,'skipped':0,'unchanged':0}:
            self.logger.warn(
                    'unexpected result attempting to delete id=%s from '
                    'rethinkdb services table: %s', id, result)
333271
def kill_redis(self, check_alive=True):
        
        self._kill_process_type(
            ray_constants.PROCESS_TYPE_REDIS_SERVER, check_alive=check_alive)