From 7132bd3dcd72c41ce8355319af83193e20008e55 Mon Sep 17 00:00:00 2001 From: Gavin Dmello Date: Fri, 14 Jul 2017 12:10:11 +0530 Subject: [PATCH] Updated docs for client unsubscribe function --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b3b8fe87..48b23f1e 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,7 @@ server.listen(8883, function () { * client.clean * client.publish() * client.subscribe() + * client.unsubscribe() * client.close() ------------------------------------------------------- @@ -84,7 +85,7 @@ Options: such as [MQEmitterRedis](http://npm.im/mqemitter-redis) or [MQEmitterMongoDB](http://npm.im/mqemitter-mongodb) * `persistence`: an instance of [AedesPersistence](http://npm.im/aedes-persistence), - such as [aedes-persistence-redis](http://npm.im/aedes-persistence-redis), + such as [aedes-persistence-redis](http://npm.im/aedes-persistence-redis), [aedes-persistence-nedb](http://npm.im/aedes-persistence-nedb) or [aedes-persistence-mongodb](http://npm.im/aedes-persistence-mongodb) * `concurrency`: the max number of messages delivered concurrently, @@ -362,6 +363,19 @@ specifying a `messageId` will send suback to the client. `callback`  will be called when the subscription is completed. +------------------------------------------------------- + +### client#unsubscribe(topicObjects, [callback]) + +Unsubscribe the client to the list of topics. + +The topic objects can be as follows :- + +1. a single object in the format `{ topic: topic, qos: qos }` +2. an array of the above + +`callback`  will be called when the unsubscriptions are completed. + ------------------------------------------------------- ### client#close([cb])