Unregister this worker in Redis
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);
    }
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)
131622
def _clear(self, pipe=None):
        
        redis = self.redis if pipe is None else pipe
        redis.delete(self.key)
656097
function unregister() {
    if (!applicationCurrent) {
        return;
    }
    applicationCurrent.stop();

    EVENTS.forEach(function (event) {
        process.removeListener(event, currentHandlers[event]);
    });

    applicationCurrent = null;
    currentHandlers = {};
}
1329339
public static function unregister()
    {
        self::$registered = false;
        in_array(vfsStream::SCHEME, stream_get_wrappers()) and
            stream_wrapper_unregister(vfsStream::SCHEME);
    }
234509
def unregister(self, itemtype, item_id):
        '''
        
        '''
        if itemtype not in [ZooConst.CLIENT, ZooConst.WORKER, ZooConst.BROKER]:
            raise Exception('Zooborg.unregister: invalid type')
        self.initconn()
        self.zk.ensure_path("/distark/" + itemtype + "/list")
        path=''.join(['/distark/' + itemtype + '/list/', item_id])
        if self.zk.exists(path):
            self.zk.delete(path, recursive=True)
215840
def unregister(self, observers):
        
        """

        if isinstance(observers, list) or isinstance(observers, tuple):
            for observer in observers:
                try:
                    index = self._observers.index(observer)
                    self._observers.remove(self._observers[index])
                except ValueError:
                    # logging
                    print('{observer} not in list...'.format(observer))

        elif isinstance(observers, base.Observer):
            try:
                index = self._observers.index(observers)
                self._observers.remove(self._observers[index])
            except ValueError:
                # logging
                print('{observer} not in list...'.format(observers))

        else:
            err_message = ('ConfigReader.register support'
                           'ListType, TupleType and {observer} Object.'
                           ''.format(base.Observer.__name__)
                           )

            raise ValueError(err_message)
563855
def unregister(self):
        '''

        ''' 
        self.task_master.worker_unregister(self.worker_id)
        self.task_master.worker_id = None
        self.worker_id = None
957833
def delete(self):
        
        result = yield gen.Task(RedisSession._redis_client.delete, self._key)
        LOGGER.debug('Deleted session %s (%r)', self.id, result)
        self.clear()
        raise gen.Return(result)
1126225
def unregister(self, event):
        
        if self.running:
            raise RuntimeError("Can't unregister while running")
        self._handlers.pop(event, None)
517900
void unregisterJob(final ExecutionGraph eg) {

		final Iterator<ExecutionVertex> it = new ExecutionGraphIterator(eg, true);
		while (it.hasNext()) {
			this.splitMap.remove(it.next().getID());
		}
	}
1061680
def unregister_all(self):
        
        aliases = list(self._service_objects.keys())
        for alias in aliases:
            self.unregister(alias)
405578
def unregister(self, handler):
        
        for handler_obj in self.handlers:
            registered = handler_obj.handler
            if handler is registered:
                self.handlers.remove(handler_obj)
                return True
        raise ValueError('This handler is not registered!')
885384
def unregister_worker(exception = nil)
      # If we're still processing a job, make sure it gets logged as a
      # failure.
      if (hash = processing) && !hash.empty?
        job = Job.new(hash['queue'], hash['payload'])
        # Ensure the proper worker is attached to this job, even if
        # it's not the precise instance that died.
        job.worker = self
        begin
          job.fail(exception || DirtyExit.new("Job still being processed"))
        rescue RuntimeError => e
          log_with_severity :error, e.message
        end
      end

      kill_background_threads

      data_store.unregister_worker(self) do
        Stat.clear("processed:#{self}")
        Stat.clear("failed:#{self}")
      end
    rescue Exception => exception_while_unregistering
      message = exception_while_unregistering.message
      if exception
        message += "\nOriginal Exception (#{exception.class}): #{exception.message}"
        message += "\n  #{exception.backtrace.join("  \n")}" if exception.backtrace
      end
      fail(exception_while_unregistering.class,
           message,
           exception_while_unregistering.backtrace)
    end
1297819
def delete(self, redis):
        '''  '''
        if self.index:
            redis.hdel(self.key(), getattr(self.obj, self.name))
281747
void unregistered() {
        try {
            if (!m_alreadyStopped) {
                m_alreadyStopped = true;
                try {
                    m_handler.stopped(this);
                } finally {
                    try {
                        m_writeStream.shutdown();
                    } finally {
                        if (m_readStream != null) {
                            m_readStream.shutdown();
                        }
                    }
                }
            }
        } finally {
            networkLog.debug("Closing channel " + m_toString);
            try {
                m_channel.close();
            } catch (IOException e) {
                networkLog.warn(e);
            }
        }
    }
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