Skip to content

Commit 4178b67

Browse files
authored
Clarify when Client.close must be called (#1255)
1 parent 719dc5f commit 4178b67

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkgs/http/lib/src/client.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,11 @@ abstract interface class Client {
148148

149149
/// Closes the client and cleans up any resources associated with it.
150150
///
151-
/// It's important to close each client when it's done being used; failing to
152-
/// do so can cause the Dart process to hang.
151+
/// Some clients maintain a pool of network connections that will not be
152+
/// disconnected until the client is closed. This may cause programs using
153+
/// using the Dart SDK (`dart run`, `dart test`, `dart compile`, etc.) to
154+
/// not terminate until the client is closed. Programs run using the Flutter
155+
/// SDK can still terminate even with an active connection pool.
153156
///
154157
/// Once [close] is called, no other methods should be called. If [close] is
155158
/// called while other asynchronous methods are running, the behavior is

0 commit comments

Comments
 (0)