Support running multiprocessing example without Bazel

pull/22643/head
Richard Belleville 5 years ago
parent 96024a9ad3
commit e97cd37e68
  1. 2
      examples/python/multiprocessing/BUILD
  2. 8
      examples/python/multiprocessing/README.md
  3. 4
      examples/python/multiprocessing/client.py
  4. 4
      examples/python/multiprocessing/server.py

@ -44,6 +44,7 @@ py_binary(
":prime_proto_pb2_grpc",
"//src/python/grpcio/grpc:grpcio",
],
imports = ["."],
)
py_binary(
@ -60,6 +61,7 @@ py_binary(
"//conditions:default": ["@futures//:futures"],
"//:python3": [],
}),
imports = ["."],
)
py_test(

@ -64,3 +64,11 @@ For example,
```
bazel run //examples/python/multiprocessing:client -- [::]:33915
```
Alternatively, generate code using the following and then run the client and server
directly:
```python
cd examples/python/helloworld
python -m grpc_tools.protoc -I . prime.proto --python_out=. --grpc_python_out=.
```

@ -26,8 +26,8 @@ import sys
import grpc
from examples.python.multiprocessing import prime_pb2
from examples.python.multiprocessing import prime_pb2_grpc
import prime_pb2
import prime_pb2_grpc
_PROCESS_COUNT = 8
_MAXIMUM_CANDIDATE = 10000

@ -29,8 +29,8 @@ import sys
import grpc
from examples.python.multiprocessing import prime_pb2
from examples.python.multiprocessing import prime_pb2_grpc
import prime_pb2
import prime_pb2_grpc
_LOGGER = logging.getLogger(__name__)

Loading…
Cancel
Save