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

        $id = (string)$this;
        Resque::redis()->srem('workers', $id);
        Resque::redis()->del('worker:' . $id);
        Resque::redis()->del('worker:' . $id . ':started');
        Resque_Stat::clear('processed:' . $id);
        Resque_Stat::clear('failed:' . $id);
        Resque::redis()->hdel('workerLogger', $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);
            }
        }
    }
750942
protected function teardown(): void
    {
        if ($this->worker) {
            @$this->worker->unregisterAll();
            $this->worker = null;
        }
    }
392079
private static void unregisterMBean(String name) {
        MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
        try {
            synchronized (mbs) {
                ObjectName objName = new ObjectName(name);
                if (mbs.isRegistered(objName)) {
                    mbs.unregisterMBean(objName);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
186867
def unregister(self, fileobj):
        
        try:
            key = self._fd_to_key.pop(self._fileobj_lookup(fileobj))
        except KeyError:
            raise KeyError("{0!r} is not registered".format(fileobj))

        # Getting the fileno of a closed socket on Windows errors with EBADF.
        except socket.error as err:
            if err.errno != errno.EBADF:
                raise
            else:
                for key in self._fd_to_key.values():
                    if key.fileobj is fileobj:
                        self._fd_to_key.pop(key.fd)
                        break
                else:
                    raise KeyError("{0!r} is not registered".format(fileobj))
        return key
1278926
def stop(self):
        """"""
        if self.running and self.num_workers:
            for worker in self.workers:
                self.queue.put(None)
            for worker in self.workers:
                worker.join()
            # Free up references held by workers
            del self.workers[:]
            self.queue.join()
        self.running = False
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()
46424
def system_unregister_worker # :nodoc
      self.class.with_global_lock do
        workers = self.class.system_registered_workers
        workers.delete(self.id)
        self.class.store_global_property(WORKERS_KEY, workers.join(','))
      end
    end
1182527
function unqueue(done) {
    var storage = this;

    this.redis().lpop(this.queueKey(), function(err, key) {
        if (err) return done(err);

        storage.redis().get(key, function(err, task) {
            if (err) return done(err);
            if (!task) return done();

            storage.redis().del(key);
            done(null, JSON.parse(task), key);
        });
    });
}
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
360385
def unregister(self, thread):
        
        if thread not in self.threads.keys():
            self.log.warning("Can not unregister thread %s" % thread)
        else:
            del (self.threads[thread])
            self.__log.debug("Thread %s got unregistered" % thread)
1126225
def unregister(self, event):
        
        if self.running:
            raise RuntimeError("Can't unregister while running")
        self._handlers.pop(event, None)
1112952
public function unregisterWorker($id): void
    {
        $this->client->srem('workers', $id);
        $worker_key = sprintf('worker:%s', $id);
        $worker_started = sprintf('%s:started', $worker_key);
        $this->client->del([$worker_key, $worker_started]);
        $this->deleteStats($id);
    }
221521
public static function unregisterFatal()
    {
        Pool::createPool();

        // Disabled?
        if (static::$pool->config->getSetting(Fallback::SETTING_DISABLED) ||
            Config::$disabledByPhp
        ) {
            return;
        }

        static::$pool->createClass('Brainworxx\\Krexx\\Controller\\ErrorController')
            ->unregisterFatalAction();
    }
213536
async def on_shutdown(app):
    
    # Remove webhook.
    await bot.delete_webhook()

    # Close Redis connection.
    await dp.storage.close()
    await dp.storage.wait_closed()
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);
    }
849205
def unregister(self):
        """"""
        pdu = RegisterForeignDevice(0)
        pdu.pduDestination = self.bbmdAddress

        # send it downstream
        self.request(pdu)

        # change the status to unregistered
        self.registrationStatus = -2

        # clear the BBMD address and time-to-live
        self.bbmdAddress = None
        self.bbmdTimeToLive = None