UNSUBSCRIBE

@param array $topics Topic Filters
@return bool
@throws Exception
3877
public function unsubscribe(array $topics)
    {
        foreach ($topics as $topic_filter) {
            $this->topics_to_unsubscribe[] = $topic_filter;
        }
        list($last_unsubscribe_msgid, $last_unsubscribe_topics) = $this->do_unsubscribe();
        $this->unsubscribe_awaits[$last_unsubscribe_msgid] = $last_unsubscribe_topics;
    }
56744
public function onUnSubscribe(Conn $conn, $topic)
    {
        $topic->broadcast($conn->resourceId . " has left " . $topic->getId());
    }
1007452
public function onSubscribe(Conn $conn, $topic)
    {
        $topic->broadcast($conn->resourceId . " has joined " . $topic->getId());
    }
409748
protected function do_unsubscribe()
    {
        /**
         * Packet Identifier Generator
         *
         * @var PacketIdentifier $pi
         */
        static $pi = null;
        if (!$pi) {
            $pi = $this->PIG();
        }

        $msgid = $pi->next();

        # send SUBSCRIBE
        /**
         * @var Message\UNSUBSCRIBE $unsubscribeobj
         */
        $unsubscribeobj = $this->getMessageObject(Message::UNSUBSCRIBE);
        $unsubscribeobj->setMsgID($msgid);

        $unsubscribe_topics = array();
        # no need to check if topic is subscribed before unsubscribing
        foreach ($this->topics_to_unsubscribe as $tn => $topic_filter) {
            $unsubscribeobj->addTopic($topic_filter);
            unset($this->topics_to_unsubscribe[$tn]);
            $unsubscribe_topics[] = $topic_filter;
        }

        $unsubscribe_bytes_written = $this->message_write($unsubscribeobj);

        Debug::Log(Debug::DEBUG, 'unsubscribe(): bytes written=' . $unsubscribe_bytes_written);

        return array($msgid, $unsubscribe_topics);
    }
990672
public function unsubscribe()
    {
        if ($this->type != "subscription") {
            throw new Exceptions\ChannelException("The current user is not subscribed to this channel.");
        }

        Connection::sendCurlRequest(Connection::URL_SUBSCRIPTIONS . '/' . $this->iden, 'DELETE', null, false,
            $this->apiKey);
    }
1279137
function unsubscribe(name, id, callback) {
        if (typeof name !== s_string) {
            throw new TypeError('topic name must be a string.');
        }
        if (id === undefined || id === null) {
            if (typeof callback === s_function) {
                id = callback;
            }
            else {
                delete _topics[name];
                return;
            }
        }
        if (typeof id === s_function) {
            callback = id;
            id = null;
        }
        if (id === null) {
            if (_id === null) {
                if (_topics[name]) {
                    var topics = _topics[name];
                    for (id in topics) {
                        delTopic(topics, id, callback);
                    }
                }
            }
            else {
                _id.then(function(id) {
                    unsubscribe(name, id, callback);
                });
            }
        }
        else if (Future.isPromise(id)) {
            id.then(function(id) {
                unsubscribe(name, id, callback);
            });
        }
        else {
            delTopic(_topics[name], id, callback);
        }
        if (isObjectEmpty(_topics[name])) {
            delete _topics[name];
        }
    }
671080
public function onPublish(ConnectionInterface $connection, Topic $topic, WampRequest $request, $event, array $exclude, array $eligible)
    {
        /*
            $topic->getId() will contain the FULL requested uri, so you can proceed based on that

            if ($topic->getId() == "chat/channel/shout") ????????????????¿¿¿¿¿¿¿¿¿¿¿¿¿¿
               //shout something to all subs.
        */

        $topic->broadcast([
            'msg' => $event
        ]);
    }
1008733
public function unsubscribe($applicationName = NULL, $eventSources = NULL)
	{
		try {

			if (is_null($applicationName))
				throw new Exception("Application name not provided or is null", 503);
			if (is_null($eventSources))
				throw new Exception("eventSources not provided or is null", 503);

			$this->validate_event_sources($eventSources);

			$postObjParams = array(
				'eventSource' => $eventSources
			);

			$uri = "/applications/" . $applicationName . "/subscription";

			$this->ariEndpointOptions['json'] = $postObjParams;

			$result = json_decode($this->ariEndpointClient->delete($this->ariEndpointURL . $uri, $this->ariEndpointOptions)->getBody()->getContents());


			return $result;

		} catch (\GuzzleHttp\Exception\RequestException $e) {
			$this->phpariObject->lasterror = $e->getMessage();
			$this->phpariObject->lasttrace = $e->getTraceAsString();
			return (int)$e->getCode();
		} catch (\GuzzleHttp\Exception\ClientException $e) {
			$this->phpariObject->lasterror = $e->getMessage();
			$this->phpariObject->lasttrace = $e->getTraceAsString();
			return (int)$e->getCode();
		} catch (\GuzzleHttp\Exception\ServerException $e) {
			$this->phpariObject->lasterror = $e->getMessage();
			$this->phpariObject->lasttrace = $e->getTraceAsString();
			return (int)$e->getCode();
		} catch (Exception $e) {
			$this->phpariObject->lasterror = $e->getMessage();
			$this->phpariObject->lasttrace = $e->getTraceAsString();

			return FALSE;
		}

	}
866831
public function unsubscribe(KEventPublisherInterface $publisher)
    {
        $handle = $publisher->getHandle();

        if($this->isSubscribed($publisher));
        {
            foreach ($this->__publishers[$handle] as $index => $listener)
            {
                $publisher->removeListener($listener, array($this, $listener));
                unset($this->__publishers[$handle][$index]);
            }
        }
    }
1135773
def _bind_topics(self, topics):
        

        # FIXME: Allow for these subscriptions to fail and clean up the previous ones
        # so that this function is atomic

        self.client.subscribe(topics.status, self._on_status_message)
        self.client.subscribe(topics.tracing, self._on_trace)
        self.client.subscribe(topics.streaming, self._on_report)
        self.client.subscribe(topics.response, self._on_response_message)
490597
async def unsubscribe(self, topic):
        
        if self.socket_type not in {SUB, XSUB}:
            raise AssertionError(
                "A %s socket cannot unsubscribe." % self.socket_type.decode(),
            )

        # Do this **BEFORE** awaiting so that new connections created during
        # the execution below honor the setting.
        self._subscriptions.remove(topic)
        tasks = [
            asyncio.ensure_future(
                peer.connection.local_unsubscribe(topic),
                loop=self.loop,
            )
            for peer in self._peers
            if peer.connection
        ]

        if tasks:
            try:
                await asyncio.wait(tasks, loop=self.loop)
            finally:
                for task in tasks:
                    task.cancel()
133764
def unregister_subscriber(topic)
      code, message,val = @proxy.unregisterSubscriber(@caller_id,
                                                      topic,
                                                      @slave_uri)
      if code == 1
        return true
      elsif code == 0
        puts message
        return true
      else
        raise message
      end
    end
483445
def unsubscribe(self, topic):
        """"""
        if self.sock == NC.INVALID_SOCKET:
            return NC.ERR_NO_CONN
        
        self.logger.info("UNSUBSCRIBE: %s", topic)
        return self.send_unsubscribe(False, [utf8encode(topic)])
341683
function unsuspendSubscriber (topic, token) {
    if (typeof token === 'string') {
      return !!applyTopicDescendents(
        unsuspendTopic, 'subscriptions', token, topic
      );
    }

    var node = ancestorTopicSearch(token.topic, topic);
    if (node.topic !== token.topic) {
      return false;
    }

    var i = searchAround(
      getId, getPriority,
      token.id, token.priority,
      binaryIndexBy(getPriority, token.priority, node.subscriptions),
      node.subscriptions
    );

    if (i === -1) {
      return false;
    }

    return !!unsuspendNode(node.subscriptions[i]);
  }
271456
private function unmapTopic($topic)
    {
        if (array_key_exists($topic, self::ID_TO_TOPIC_ENUM)) {
            $result = self::ID_TO_TOPIC_ENUM[$topic];
            $this->logger->debug(sprintf('Topic ID "%s" has been unmapped to "%s".', $topic, $result));
        } else {
            $result = $topic;
            $this->logger->debug(sprintf('Topic ID "%s" does not exist in enum.', $topic));
        }

        return $result;
    }
662421
def handle_unsubscribe(client, data)
      topic = @engine.unsubscribe_client_from_topic(client, data[0])

      trigger(:unsubscribe, client, topic.uri)
    end
1228392
public function unsubscribe($name, $id = null, $callback = null) {
        $self = $this;
        if (!is_string($name)) {
            throw new TypeError('topic name must be a string');
        }
        if (($id === null) && ($callback === null)) {
            unset($this->topics[$name]);
            return;
        }
        if (is_callable($id) && !is_callable($callback)) {
            $callback = $id;
            $id = null;
        }
        if ($id === null) {
            if ($this->id === null) {
                if (isset($this->topics[$name])) {
                    $topics = $this->topics[$name];
                    $ids = array_keys($topics);
                    foreach ($ids as $id) {
                        $this->delTopic($topics, $id, $callback);
                    }
                }
            }
            else {
                $this->id->then(function($id) use ($self, $name, $callback) {
                    $self->;
                });
            }
        }
        elseif (Future\isFuture($id)) {
            $id->then(function($id) use ($self, $name, $callback) {
                $self->;
            });
        }
        else {
            $this->delTopic($this->topics[$name], $id, $callback);
        }
        if (isset($this->topics[$name]) && count($this->topics[$name]) === 0) {
            unset($this->topics[$name]);
        }
    }