grpc-svcs: A gRPC integration for SVCS
Very in-development
Installation
pip install grpc-svcs
Usage
import grpc_svcs
import svcs
registry = svcs.Registry()
# Register services
registry.register_value(MyType, MyType())
# Attach a `SVCSInterceptor` when creating server.
server = grpc.server(intercepters=[grpc_svcs.SVCSInterceptor(registry)])
# Attach a `SVCSAsyncIntercept` when creating an async server.
server = grpc.aio.server(intercepters=[grpc_svcs.SVCSAsyncInterceptor(registry)])
# Retrieve container inside a servicer
class Greeter(helloworld_pb2_grpc.GreeterServicer):
def SayHello(self, request, context):
# call svcs_from
container = grpc_svcs.svcs_from()
# get items from svcs
my_type = container.get(MyType)
return helloworld_pb2.HelloReply(message="Hello, %s!" % request.name)
Release files for grpc-svcs 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| grpc_svcs-0.1.2.tar.gz | 2.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| grpc_svcs-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.8 kB
Release files / grpc_svcs-0.1.2.tar.gz
| Download URL | grpc_svcs-0.1.2.tar.gz |
|---|---|
| Size | 2.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
acefd6558d8d36787d2d2a04fcdacfacee83f9db91b5d5b3a399dc9b3f456b1b
|
|
BLAKE2b-256 checksum How to use checksums |
c5a2d21669df3ed1e0d03f60617a77e35f2dd4f9eee705b74d22f485a040f61c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.1
|
Release files / grpc_svcs-0.1.2-py3-none-any.whl
| Download URL | grpc_svcs-0.1.2-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7faa0abac0928b392a7a7320cfa4aac2c298717021e0c5a55764894045028032
|
|
BLAKE2b-256 checksum How to use checksums |
f7c81f503aa1b0dbb253c8d7f33d1342f6b7926e593e83e0a2741a819473ab2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.1
|