docs: function subscribe(api, feed, callback) {
      // A unique-enough ID for this subscription
      let id = ++api._subLinksId;
  
      // Attempt to connect to push API
      connect(api, (err) => {
          if (err) {
              // Notify caller of the connection error
              callback({"msg": "Error: " + err.msg}, null, null, null);
          } else {
              // Proxy for user-supplied callback
              let callbackProxy = (args, kwargs, details) => {
                  // Execute user callback, checking return value for kill signal (anything not false)
                  if (callback(null, args, kwargs, details)) {
                      // Unsubscribe
                      api._connection.session.unsubscribe(api._subLinks[id]);
  
                      // Remove internal reference
                      delete api._subLinks[id];
  
                      // Decrement active subscription counter
                      api._activeSubs--;
  
                      // If no subscriptions remain
                      if (api._activeSubs == 0) {
                          // Close the entire connection (allows program to exit naturally; can be reopened if needed)
                          api._connection.close();
                      }
                  }
              };
  
              // Subscribe to the given feed
              api._connection.session.subscribe(feed, callbackProxy).then(
                  (subscription) => {
                      // Register subscription
                      api._subLinks[id] = subscription;
  
                      // Increment active subscription counter
                      api._activeSubs++;
                  },
                  (err) => {
                      // Call back with error
                      callback({"msg": "Error: " + err}, null, null, null);
                  }
              );
          }
      });
  }