Unsubscribe all durable consumers for a given client ID and subscription name
320541
public void unsubscribe( String clientID , String subscriptionName ) throws JMSException
    {
    	String subscriberID = clientID+"-"+subscriptionName;
    	
    	subscriptionsLock.writeLock().lock();
    	try
		{
        	LocalTopicSubscription subscription = subscriptionMap.get(subscriberID);
        	if (subscription == null)
        		return;
        	
        	if (isConsumerRegistered(subscriberID))
        		throw new FFMQException("Subscription "+subscriptionName+" is still in use","SUBSCRIPTION_STILL_IN_USE");
    		
        	subscriptionMap.remove(subscriberID);
        	removeSubscription(subscription);
		}
    	finally
    	{
    		subscriptionsLock.writeLock().unlock();
    	}
    }
645461
private void deleteDurableSubscription(
    boolean callProxyCode)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "deleteDurableSubscription",
        new Object[] {
          new Boolean(callProxyCode) });

    HashMap durableSubsTable =
      _destinationManager.getDurableSubscriptionsTable();

    synchronized (durableSubsTable)
    {
      // Get the consumerDispatcher from the durable subscriptions table
      ConsumerDispatcher consumerDispatcher =
        (ConsumerDispatcher) durableSubsTable.get(
          _subState.getSubscriberID());

      //If entire topicspace has been deleted, the subscription will have already
      //been removed.
      if (consumerDispatcher != null)
      {
        // Check if the subscription from the durable subscriptions table is this
        // subscription.  Its possible that the topicspace this subscription was on
        // was deleted and a new subscription with the same id has been added into
        // the table
        if (consumerDispatcher.dispatcherStateEquals(_subState))
        {
          // Remove consumerDispatcher from durable subscriptions table
          durableSubsTable.remove(_subState.getSubscriberID());

          // Delete consumerDispatcher ( implicit remove from matchspace)
          try
          {
            // Don't need to send the proxy delete event message
            // just need to reset the memory to the stat
            consumerDispatcher.deleteConsumerDispatcher(
              callProxyCode);
          }
          catch (SIException e)
          {
            FFDCFilter.processException(
              e,
              "com.ibm.ws.sib.processor.impl.store.itemstreams.DurableSubscriptionItemStream.deleteDurableSubscription",
              "1:626:1.95",
              this);

            SibTr.exception(tc, e);

            // Could not delete consumer dispatcher
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.exit(tc, "deleteDurableSubscription", e);
          }
        }
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "deleteDurableSubscription");
  }
506771
@Override
    public java.util.concurrent.Future<UnsubscribeResult> unsubscribeAsync(String subscriptionArn,
            com.amazonaws.handlers.AsyncHandler<UnsubscribeRequest, UnsubscribeResult> asyncHandler) {

        return unsubscribeAsync(new UnsubscribeRequest().withSubscriptionArn(subscriptionArn), asyncHandler);
    }
576978
@Override
	public void unregisterConsumer(LocalMessageConsumer consumer)
    {
        super.unregisterConsumer(consumer);
        if (!consumer.isDurable())
        {
            log.debug("Removing non-durable subscription "+consumer.getSubscriberId());
            subscriptionsLock.writeLock().lock();
            try
    		{
            	LocalTopicSubscription subscription = subscriptionMap.remove(consumer.getSubscriberId());
            	if (subscription != null)
            		removeSubscription(subscription);
    		}
            finally
            {
            	subscriptionsLock.writeLock().unlock();
            }
        }
    }
40303
def endSubscription(self, subscriber):
        
        self._reqId2Contract.pop(subscriber.reqId, None)
        self.reqId2Subscriber.pop(subscriber.reqId, None)
1004355
function () {
            /*  determine parameters  */
            var params = $cs.params("unsubscribe", arguments, {
                id: { pos: 0, req: true }
            });

            /*  detach parameters from component  */
            if (typeof this.__subscription[params.id] === "undefined")
                throw _cs.exception("unsubscribe", "subscription not found");
            delete this.__subscription[params.id];
            return;
        }
363116
async def unsubscribe(self):
        
        await self._nc.unsubscribe(self.sid)

        try:
            # Stop the processing task for the subscription.
            sub = self._sc._sub_map[self.inbox]
            sub._msgs_task.cancel()
            del self._sc._sub_map[self.inbox]
        except KeyError:
            pass

        req = protocol.UnsubscribeRequest()
        req.clientID = self._sc._client_id
        req.subject = self.subject
        req.inbox = self.ack_inbox

        if self.durable_name is not None:
            req.durableName = self.durable_name

        msg = await self._nc.request(
            self._sc._unsub_req_subject,
            req.SerializeToString(),
            self._sc._connect_timeout,
            )
        resp = protocol.SubscriptionResponse()
        resp.ParseFromString(msg.data)

        if resp.error != "":
            raise StanError(resp.error)
1311825
def unsubscribe(self, subscriber: 'Subscriber') -> None:
        
        # here is a special implementation which is replacing the more
        # obvious one: self._subscriptions.remove(subscriber) - this will not
        # work because list.remove(x) is doing comparision for equality.
        # Applied to publishers this will return another publisher instead of
        # a boolean result
        for i, _s in enumerate(self._subscriptions):
            if _s is subscriber:
                self._subscriptions.pop(i)
                return
        raise SubscriptionError('Subscriber is not registered')
1255562
def remove(self):
        
        self.logger.debug('Remove subscription from server...')

        data = {
            'command': 'unsubscribe',
            'identifier': self._identifier_string()
        }

        self.connection.send(data)
        self.state = 'unsubscribed'
662421
def handle_unsubscribe(client, data)
      topic = @engine.unsubscribe_client_from_topic(client, data[0])

      trigger(:unsubscribe, client, topic.uri)
    end
976052
protected void doUnsubscribe (int oid, Subscriber<?> target)
    {
        DObject dobj = _ocache.get(oid);
        if (dobj != null) {
            dobj.removeSubscriber(target);

        } else if (_client.isFailureLoggable(Client.FailureType.UNSUBSCRIBE_NOT_PROXIED)) {
            log.info("Requested to remove subscriber from non-proxied object", "oid", oid,
                     "sub", target);
        }
    }
1373455
def auto_unsubscribe(self, sid, limit=1):
        
        if self.is_draining:
            raise ErrConnectionDraining
        yield self._unsubscribe(sid, limit)
1329612
def unsubscribe(self, channel_name):
        
        if channel_name in self.channels:
            self.connection.send_event(
                'pusher:unsubscribe', {
                    'channel': channel_name,
                }
            )
            del self.channels[channel_name]
469747
function unsubscribe(subscriber) {
    var index;

    for (var i = 0, l = subscribers.length; i < l; i++) {
      if (subscribers[i] === subscriber) {
        index = i;
      }
    }

    subscribers.splice(index, 1);
    cache = {};
  }
668482
def delete_connection(api)
      @subscribers.delete_if {|x| x.api == api}
      @publishers.delete_if {|x| x.api == api}
      @services.delete_if {|x| x.api == api}
    end
1263275
@SuppressWarnings("unlikely-arg-type")
    public boolean unsubscribe(IConsumer consumer) {
        if (consumers.remove(consumer)) {
            fireConsumerConnectionEvent(consumer, PipeConnectionEvent.EventType.CONSUMER_DISCONNECT, null);
            listeners.remove(consumer);
            return true;
        }
        return false;
    }
141467
def delete_subscription(self, subscription_id):
        
        url = self.SUBSCRIPTIONS_ID_URL % subscription_id

        connection = Connection(self.token)
        connection.set_url(self.production, url)

        return connection.delete_request()