Skip to content

Commit 2d072c6

Browse files
authored
Update interceptor docs (connectrpc#200)
Updating inline docs to reflect connectrpc/connectrpc.com#68.
1 parent 614fe6a commit 2d072c6

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

Libraries/Connect/Interfaces/Interceptors/Interceptor.swift

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,23 @@
2222
///
2323
/// Every interceptor has the opportunity to perform asynchronous work before passing a potentially
2424
/// altered value to the next interceptor in the chain. When the end of the chain is reached, the
25-
/// final value is passed to the networking client where it is sent to the server (outbound request)
26-
/// or to the caller (inbound response).
25+
/// final value is passed to the networking client, where it is sent to the server
26+
/// (outbound request) or to the caller (inbound response).
2727
///
28-
/// Interceptors may also fail outbound requests before they're sent, thus preventing subsequent
29-
/// interceptors from being invoked and returning a specified error back to the original caller.
28+
/// Interceptors may also fail outbound requests before they are sent; subsequent
29+
/// interceptors in the chain will not be invoked, and the error will be returned to the
30+
/// original caller.
3031
///
31-
/// Interceptors are closure-based and are passed both the current value and a closure which
32+
/// Interceptors are closure-based and receive both the current value and a closure that
3233
/// should be called to resume the interceptor chain. Propagation will not continue until
33-
/// this closure is called. Additional values may still be passed to a given interceptor even
34+
/// this closure is invoked. Additional values may still be passed to a given interceptor even
3435
/// though it has not yet continued the chain with a previous value. For example:
3536
///
36-
/// - A request is sent
37-
/// - Response headers are received, and an interceptor pauses the chain while processing them
38-
/// - First chunk of streamed data is received, and the interceptor is invoked with this value
39-
/// - Interceptor is expected to resume with headers first, and then with data after
37+
/// 1. A request is sent
38+
/// 2. Response headers are received, and an interceptor pauses the chain while processing them
39+
/// 3. The first chunk of streamed response data is received, and the interceptor is invoked with
40+
/// this value
41+
/// 4. The interceptor is expected to resume with headers first, and then with data after
4042
///
4143
/// Implementations should be thread-safe (hence the `Sendable` requirement on interceptor
4244
/// closures), as closures can be invoked from different threads during the span of a request or

0 commit comments

Comments
 (0)