docs: function connect(api, callback) {
      // Check if currently connected
      if (api._connection.isConnected) {
          // Check if session is currently open
          if (api._connection.session.isOpen) {
              // Call back if connected
              callback(null);
          } else {
              // Try again at a later time
              let trials = 0;
              let retryInterval = setInterval(function() {
                  // Check if session is currently open
                  if (api._connection.session.isOpen) {
                      // Clear the interval
                      clearInterval(retryInterval);
  
                      // Report back to caller
                      callback(null);
                  } else {
                      // Check trial limit
                      if (++trials >= SESSION_WAIT_TEST_LIMIT) {
                          // Clear the interval
                          clearInterval(retryInterval);
  
                          // Notify caller of error
                          callback({"msg": "The session did not open in a timely manner"});
                      }
                  }
              }, SESSION_WAIT_TEST_INTERVAL);
          }
      } else {
          // Function-to-be to clean up the following callbacks
          let doCleanup;
  
          // Set up handler for connection open event
          let onOpen = function() {
              // Clean up
              if (doCleanup) {
                  doCleanup();
              }
  
              // Connected; call back
              callback(null);
          };
  
          // Set up handler for connection close event
          let onClose = function(reason, details) {
              // Clean up
              if (doCleanup) {
                  doCleanup();
              }
  
              // The only reason we might have closed here is a first-time connect error; act accordingly
              if (reason == "unreachable") {
                  callback({"msg": "Poloniex push API is unreachable"});
              } else {
                  callback({"msg": "Unexpected Autobahn|JS error", "evReason": reason, "evDetails": details});
              }
          };
  
          // Aforementioned cleanup function
          doCleanup = function() {
              // Remove callbacks from respective arrays
              api._cxnCallbacksOpen.splice(api._cxnCallbacksOpen.indexOf(onOpen), 1);
              api._cxnCallbacksClose.splice(api._cxnCallbacksClose.indexOf(onClose), 1);
          };
  
          // Publish the callbacks
          api._cxnCallbacksOpen.push(onOpen);
          api._cxnCallbacksClose.push(onClose);
  
          // Try to open connection
          api._connection.open();
      }
  }