Skip to content

Commit 953e176

Browse files
committed
Document client constructor
1 parent f8b7492 commit 953e176

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/interceptors.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,20 @@ To apply our new interceptor to handlers, we can pass it to the application with
154154
app = GreetingServiceWSGIApplication(service, interceptors=[GoodbyeInterceptor(["user1", "user2"])])
155155
```
156156

157+
Client constructors also accept an `interceptors=` parameter.
158+
159+
=== "Async"
160+
161+
```python
162+
client = GreetingServiceClient("http://localhost:8000", interceptors=[GoodbyeInterceptor(["user1", "user2"])])
163+
```
164+
165+
=== "Sync"
166+
167+
```python
168+
client = GreetingServiceClientSync("http://localhost:8000", interceptors=[GoodbyeInterceptor(["user1", "user2"])])
169+
```
170+
157171
## Metadata interceptors
158172

159173
Because the signature is different for each RPC type, we have an interceptor protocol for each

0 commit comments

Comments
 (0)