close method

void close()

Note: this method needs to be called only when the PocketBase client instance is created with the reuseHTTPClient option.

Closes the shared HTTP client and cleans up any resources associated with it.

Once closed, the client instance should be discarded and no further requests can be made with it.

Calling close multiple times is allowed and does nothing. If close is called while other asynchronous methods are running, the behavior is undefined.

Implementation

void close() {
  if (!_closed && _sharedHTTPClient != null) {
    _sharedHTTPClient?.close();
    _closed = true;
  }
}