Skip to content

Commit 5bbe93d

Browse files
committed
Improve aleph.http/cancel-request! docstring
1 parent 07a4586 commit 5bbe93d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/aleph/http.clj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,11 +453,13 @@
453453
result)))
454454

455455
(defn cancel-request!
456-
"Accepts a response deferred as returned by `request` and cancels the underlying request if it is
457-
still in flight.
456+
"Accepts a response deferred as returned by `request` and closes the underlying TCP connection. If
457+
the request had already completed by the time this function is invoked, it has no effect (as per
458+
Manifold deferred semantics). If cancellation succeeded, the deferred will be put into error state
459+
with an `aleph.utils.RequestCancellationException` instance.
458460
459-
This is done by putting the deferred into error state with an
460-
`aleph.utils.RequestCancellationException` instance as its value."
461+
Note that the request may already have been (partially) processed by the server at the point of
462+
cancellation."
461463
[r]
462464
(d/error! r (RequestCancellationException. "Request cancelled")))
463465

0 commit comments

Comments
 (0)