Skip to content

Commit

Permalink
docs: document grpc client limitation (#5193)
Browse files Browse the repository at this point in the history
  • Loading branch information
alaeddine-13 committed Sep 22, 2022
1 parent 96c5e7c commit 842a585
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion docs/fundamentals/client/client.md
Expand Up @@ -128,7 +128,7 @@ Client(host='my.awesome.flow', port=1234, protocol='grpc', tls=True)
````


You can also use a mixe of both:
You can also use a mix of both:

```python
from jina import Client
Expand All @@ -148,6 +148,15 @@ Client(host='https://my.awesome.flow:1234', port=4321)
```
````

````{admonition} Caution
:class: caution
In case you instanciate a `Client` object using the `grpc` protocol, keep in mind that `grpc` clients cannot be used in
a multi-threaded environment (check [this gRPC issue](https://github.com/grpc/grpc/issues/25364) for reference).
What you should do, is to rely on asynchronous programming or multi-processing rather than multi-threading.
For instance, if you're building a web server, you can introduce multi-processing based parallelism to your app using
`gunicorn`: `gunicorn main:app --workers 4 --worker-class uvicorn.workers.UvicornWorker ...`
````



## Test readiness of the Flow
Expand Down

0 comments on commit 842a585

Please sign in to comment.