Stop a Stream owned by the given Kickflip User.

@param cb This callback will receive a Stream subclass in #onSuccess(response)
depending on the Kickflip account type. Implementors should
check if the response is instanceof HlsStream, etc.
173503
private void stopStream(User user, Stream stream, final KickflipCallback cb) {
        checkNotNull(stream);
        // TODO: Add start / stop lat lon to Stream?
        GenericData data = new GenericData();
        data.put("stream_id", stream.getStreamId());
        data.put("uuid", user.getUUID());
        if (stream.getLatitude() != 0) {
            data.put("lat", stream.getLatitude());
        }
        if (stream.getLongitude() != 0) {
            data.put("lon", stream.getLongitude());
        }
        post(STOP_STREAM, new UrlEncodedContent(data), HlsStream.class, cb);
    }
1340551
function abort (err, stream, db, cb) {
  debug('aborting with error: ' + err);
  stream.destroy();
  db.close(function () {
    cb(err);
  })
}
698457
@RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
	public final void stopScan(@NonNull final ScanCallback callback) {
		//noinspection ConstantConditions
		if (callback == null) {
			throw new IllegalArgumentException("callback is null");
		}
		stopScanInternal(callback);
	}
1061865
public void invokeUnchecked(CodeBuilder cb) {
    cb.visitMethodInsn(
        opcode(),
        owner().internalName(),
        method().getName(),
        method().getDescriptor(),
        // This is for whether the methods owner is an interface.  This is mostly to handle java8
        // default methods on interfaces.  We don't care about those currently, but ASM requires
        // this.
        opcode() == Opcodes.INVOKEINTERFACE);
  }
230854
@Override
    public boolean stop() {
        synchronized(MetricCollectorSupport.class) {
            if (uploaderThread != null) {
                uploaderThread.cancel();
                uploaderThread.interrupt();
                uploaderThread = null;
                if (singleton == this) { // defensive check
                    singleton = null;
                }
                return true;
            }
        }
        return false;
    }
1071110
public Closeable onUnsubscribeChannelEvent(final Consumer<BitfinexStreamSymbol> listener) {
        unsubscribeChannelConsumers.offer(listener);
        return () -> unsubscribeChannelConsumers.remove(listener);
    }
1188858
def _on_stream_disconnect(self, stream):
        
        # During a stream crash it is possible for disconnect signal to fire
        # twice, in which case ignore the second instance.
        routes = self._routes_by_stream.pop(stream, None)
        if routes is None:
            return

        LOG.debug('%r: %r is gone; propagating DEL_ROUTE for %r',
                  self, stream, routes)
        for target_id in routes:
            self.router.del_route(target_id)
            self._propagate_up(mitogen.core.DEL_ROUTE, target_id)
            self._propagate_down(mitogen.core.DEL_ROUTE, target_id)

            context = self.router.context_by_id(target_id, create=False)
            if context:
                mitogen.core.fire(context, 'disconnect')
1043841
public void stopTracking() {
        if (!isTracking) {
            return;
        }
        Session session = getSession();
        if (session != null) {
            session.removeCallback(callback);
        }
        broadcastManager.unregisterReceiver(receiver);
        isTracking = false;
    }
327638
public void stoppableConsumerSessionStopped () {
     if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "stoppableConsumerSessionStopped");

     try {
       stopInternal(false); // No need to notify our peer as the stop came from our peer
     } catch (Exception e) {
       FFDCFilter.processException(e, CLASS_NAME + ".processAsyncSessionStoppedCallback", CommsConstants.CONSUMERSESSIONPROXY_SESSION_STOPPED_03, this);
     }

     final AsynchConsumerCallback asynchConsumerCallback = proxyQueue.getAsynchConsumerCallback();
     if (asynchConsumerCallback instanceof StoppableAsynchConsumerCallback) {
       final StoppableAsynchConsumerCallback stoppableAsynchConsumerCallback = (StoppableAsynchConsumerCallback)asynchConsumerCallback;
       // Protect ourselves from the application as far as possible then call the application
       try {
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "** Calling application StoppableAsynchConsumerCallback");
         stoppableAsynchConsumerCallback.consumerSessionStopped();
       } catch (Throwable e) {
         FFDCFilter.processException(e, CLASS_NAME + ".stoppableConsumerSessionStopped", CommsConstants.CONSUMERSESSIONPROXY_SESSION_STOPPED_01, this);
       }
     } else {
       if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "asynchConsumerCallback not an instance of StoppableAsynchConsumerCallback is an instance of "+ asynchConsumerCallback.getClass().getName());
       SIErrorException e = new SIErrorException(nls.getFormattedMessage("WRONG_CLASS_CWSICO8022", new Object[] {asynchConsumerCallback.getClass().getName()}, null));
       FFDCFilter.processException(e, CLASS_NAME + ".processAsyncSessionStoppedCallback", CommsConstants.CONSUMERSESSIONPROXY_SESSION_STOPPED_02, this);
       SibTr.error(tc, "WRONG_CLASS_CWSICO8022", e);
       throw e;
     }

     if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "stoppableConsumerSessionStopped");
   }
730647
void stopIfNecessary() {
    synchronized (lock) {
      if (goAway && !stopped && streams.size() == 0) {
        stopped = true;
      } else {
        return;
      }
    }
    listener.transportTerminated();
  }
534690
def _destroy_stream_state(self, exc):
        
        self._logger.debug("destroying stream state (exc=%r)", exc)
        self._iq_response_map.close_all(exc)
        for task in self._iq_request_tasks:
            # we don’t need to remove, that’s handled by their
            # add_done_callback
            task.cancel()
        while not self._active_queue.empty():
            token = self._active_queue.get_nowait()
            token._set_state(StanzaState.DISCONNECTED)

        if self._established:
            self.on_stream_destroyed(exc)
            self._established = False
91729
public void stop() throws IllegalStateException {
        if (log.isDebugEnabled()) {
            log.debug("stop - subscriber stream state: {}", (subscriberStream != null ? subscriberStream.getState() : null));
        }
        // allow stop if playing or paused
        switch (subscriberStream.getState()) {
            case PLAYING:
            case PAUSED:
                subscriberStream.setState(StreamState.STOPPED);
                IMessageInput in = msgInReference.get();
                if (in != null && !pullMode) {
                    in.unsubscribe(this);
                    msgInReference.set(null);
                }
                subscriberStream.onChange(StreamState.STOPPED, currentItem.get());
                clearWaitJobs();
                cancelDeferredStop();
                if (subscriberStream instanceof IPlaylistSubscriberStream) {
                    IPlaylistSubscriberStream pss = (IPlaylistSubscriberStream) subscriberStream;
                    if (!pss.hasMoreItems()) {
                        releasePendingMessage();
                        sendCompleteStatus();
                        bytesSent.set(0);
                        sendStopStatus(currentItem.get());
                        sendClearPing();
                    } else {
                        if (lastMessageTs > 0) {
                            // remember last timestamp so we can generate correct headers in playlists.
                            timestampOffset = lastMessageTs;
                        }
                        pss.nextItem();
                    }
                }
                break;
            case CLOSED:
                clearWaitJobs();
                cancelDeferredStop();
                break;
            case STOPPED:
                log.trace("Already in stopped state");
                break;
            default:
                throw new IllegalStateException(String.format("Cannot stop in current state: %s", subscriberStream.getState()));
        }
    }
1220805
@Override
    public synchronized void stop() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "Stopping the basic FFDC service");
        }
        logSummary(true);
    }
468365
def stop(self):
        
        super(BitfinexWSS, self).stop()

        log.info("BitfinexWSS.stop(): Stopping client..")

        log.info("BitfinexWSS.stop(): Joining receiver thread..")
        try:
            self.receiver_thread.join()
            if self.receiver_thread.is_alive():
                time.time(1)
        except AttributeError:
            log.debug("BitfinexWSS.stop(): Receiver thread was not running!")

        log.info("BitfinexWSS.stop(): Joining processing thread..")
        try:
            self.processing_thread.join()
            if self.processing_thread.is_alive():
                time.time(1)
        except AttributeError:
            log.debug("BitfinexWSS.stop(): Processing thread was not running!")

        log.info("BitfinexWSS.stop(): Closing websocket conection..")
        try:
            self.conn.close()
        except WebSocketConnectionClosedException:
            pass
        except AttributeError:
            # Connection is None
            pass

        self.conn = None
        self.processing_thread = None
        self.receiver_thread = None

        log.info("BitfinexWSS.stop(): Done!")
861368
private void stopChain(String name, Event event) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "Stop chain event; chain=" + name);
        }
        ChannelFramework cf = ChannelFrameworkFactory.getChannelFramework();
        try {
            if (cf.isChainRunning(name)) {
                // stop the chain now.. 
                cf.stopChain(name, 0L);
            }
        } catch (Exception e) {
            FFDCFilter.processException(e, getClass().getName(), "stopChain", new Object[] { event, cf });
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Tr.event(tc, "Error stopping chain; " + e);
            }
        }
    }
474890
@Override
    public void stopAnimation(final boolean jumpToTarget) {

        if (!mMapView.getScroller().isFinished()) {
            if (jumpToTarget) {
                mMapView.mIsFlinging = false;
                mMapView.getScroller().abortAnimation();
            } else
                stopPanning();
        }

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            final Animator currentAnimator = this.mCurrentAnimator;
            if (mMapView.mIsAnimating.get()) {
                if (jumpToTarget) {
                    currentAnimator.end();
                }
                else {
                    currentAnimator.cancel();
                }
            }
        } else {
            if (mMapView.mIsAnimating.get()) {
                mMapView.clearAnimation();
            }
        }
    }
261690
def stop_receive(self, stream):
        
        _vv and IOLOG.debug('%r.stop_receive(%r)', self, stream)
        self.defer(self.poller.stop_receive, stream.receive_side.fd)