mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Documentation updates for node-red and runtime modules
This commit is contained in:
@@ -15,7 +15,8 @@
|
||||
**/
|
||||
|
||||
/**
|
||||
* @namespace RED.comms
|
||||
* This is the comms subsystem of the runtime.
|
||||
* @mixin @node-red/runtime_comms
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -89,7 +90,7 @@ var api = module.exports = {
|
||||
* @param {User} opts.user - the user calling the api
|
||||
* @param {CommsConnection} opts.client - the client connection
|
||||
* @return {Promise<Object>} - resolves when complete
|
||||
* @memberof RED.comms
|
||||
* @memberof @node-red/runtime_comms
|
||||
*/
|
||||
addConnection: function(opts) {
|
||||
connections.push(opts.client);
|
||||
@@ -102,7 +103,7 @@ var api = module.exports = {
|
||||
* @param {User} opts.user - the user calling the api
|
||||
* @param {CommsConnection} opts.client - the client connection
|
||||
* @return {Promise<Object>} - resolves when complete
|
||||
* @memberof RED.comms
|
||||
* @memberof @node-red/runtime_comms
|
||||
*/
|
||||
removeConnection: function(opts) {
|
||||
for (var i=0;i<connections.length;i++) {
|
||||
@@ -123,7 +124,7 @@ var api = module.exports = {
|
||||
* @param {CommsConnection} opts.client - the client connection
|
||||
* @param {String} opts.topic - the topic to subscribe to
|
||||
* @return {Promise<Object>} - resolves when complete
|
||||
* @memberof RED.comms
|
||||
* @memberof @node-red/runtime_comms
|
||||
*/
|
||||
subscribe: function(opts) {
|
||||
var re = new RegExp("^"+opts.topic.replace(/([\[\]\?\(\)\\\\$\^\*\.|])/g,"\\$1").replace(/\+/g,"[^/]+").replace(/\/#$/,"(\/.*)?")+"$");
|
||||
@@ -142,7 +143,7 @@ var api = module.exports = {
|
||||
* @param {CommsConnection} opts.client - the client connection
|
||||
* @param {String} opts.topic - the topic to unsubscribe from
|
||||
* @return {Promise<Object>} - resolves when complete
|
||||
* @memberof RED.comms
|
||||
* @memberof @node-red/runtime_comms
|
||||
*/
|
||||
unsubscribe: function(opts) {}
|
||||
};
|
||||
|
Reference in New Issue
Block a user