This can be registered with the raiden AlarmTask.
        If `EchoNode.stop()` is called, it will give the return signal to be removed from
        the AlarmTask callbacks.
554966
def echo_node_alarm_callback(self, block_number):
        
        if not self.ready.is_set():
            self.ready.set()
        log.debug('echo_node callback', block_number=block_number)
        if self.stop_signal is not None:
            return REMOVE_CALLBACK
        else:
            self.greenlets.add(gevent.spawn(self.poll_all_received_events))
            return True
1263385
@Override
  public void stop(ShutdownModeAmp mode)
    throws Exception
  {
    super.stop(mode);
    
    Alarm alarm = _alarm;
    _alarm = null;

    if (alarm != null) {
      alarm.dequeue();
    }

    for (PortTcp port : _ports) {
      try {
        port.close();
      } catch (Throwable e) {
        log.log(Level.WARNING, e.toString(), e);
      }
    }
    
    _clusterService.stop();
  }
429637
def clear(self, signal=None):
        
        if signal is not None:
            self._callbacks.pop(signal, None)
        else:
            self._callbacks.clear()
1157376
def stop(self, signal=None):
        
        signal = signal or self.int_signal
        self.out.log("Cleaning up local Heroku process...")
        if self._process is None:
            self.out.log("No local Heroku process was running.")
            return

        try:
            os.killpg(os.getpgid(self._process.pid), signal)
            self.out.log("Local Heroku process terminated.")
        except OSError:
            self.out.log("Local Heroku was already terminated.")
            self.out.log(traceback.format_exc())
        finally:
            self._process = None
846065
public void shutdown() {
        RequestBatch<BatchReturnType, ResponseType, RequestArgumentType> currentBatch = batch.getAndSet(null);
        if (currentBatch != null) {
            currentBatch.shutdown();
        }

        if (timerListenerReference.get() != null) {
            // if the timer was started we'll clear it so it stops ticking
            timerListenerReference.get().clear();
        }
    }
1101121
def stop(self, silent=False):
        
        self.send_stop_signal(silent)
        self._lock.wait()
400653
def stop(self):
        """"""
        if self.__task:
            self.__task.cancel()
        if self.__poller:
            self.__poller.unregister(self.zap_socket)
            self.__poller = None
        super().stop()
77196
def event_listen_stop(self):
		''''''
		self._loop_stop = True
		c.pa.mainloop_wakeup(self._loop)
1221320
function () {
    if (!self.connections.length) {
      self.removeListener('remove', remove);
      self.closing = false;
      return callback();
    }
  }
456933
protected void stop() {
        this.authenticating = false;
        // clear batcher
        batcher.clear();
        // set non-continuous
        setLifecycle(Replication.Lifecycle.ONESHOT);
        // cancel if middle of retry
        cancelRetryFuture();
        // cancel all pending future tasks.
        while (!pendingFutures.isEmpty()) {
            Future future = pendingFutures.poll();
            if (future != null && !future.isCancelled() && !future.isDone()) {
                future.cancel(true);
                CancellableRunnable runnable = cancellables.get(future);
                if (runnable != null) {
                    runnable.cancel();
                    cancellables.remove(future);
                }
            }
        }
    }
319160
async def stoplisten(self, connmark = -1):
        '''
        
        '''
        if connmark is None:
            connmark = self.connmark
        self.scheduler.emergesend(ConnectionControlEvent(self, ConnectionControlEvent.STOPLISTEN, True, connmark))
946125
def stop_capture(self):
        
        if self._process is None:
            raise sniffer.InvalidOperationError(
                                      "Trying to stop a non-started process")
        utils.stop_standing_subprocess(self._process, kill_signal=signal.SIGINT)
        self._post_process()
315813
public synchronized void stop() {
        if (scheduledFuture != null) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Tr.event(this, tc, "Scan task cancelled");
            }
            scheduledFuture.cancel(false);
            scheduledFuture = null;
        }
    }
22679
@Override
    public void stop() {
        super.stop();
        try {
            getContext().unregisterReceiver(mBroadcastReceiver);
        } catch(IllegalArgumentException e) {
            Log.d(TAG, "Unable to unregister receiver when stopping, probably not registered");
        }
    }
27017
public void stop() {
        synchronized (this.startStopMonitor) {
            doStop();

            // If we registered a JVM shutdown hook, we don't need it anymore now:
            // We've already explicitly closed the context.
            if (this.shutdownHook != null) {
                try {
                    Runtime.getRuntime().removeShutdownHook(this.shutdownHook);
                } catch (final IllegalStateException ex) {
                    // ignore - VM is already shutting down
                }
            }
        }
    }
1020584
def off(self, name, callback, once=False):
        

        if name not in self.event_listeners:
            return

        self.event_listeners[name].remove((callback, once))
930496
async def stop(self):
        
        # negate pid so that signals apply to process group
        pgid = -self.process.pid
        try:
            os.kill(pgid, signal.SIGTERM)
            await asyncio.sleep(1)
            os.kill(pgid, signal.SIGKILL)
        except (OSError, ProcessLookupError):
            return