A gRPC integration for SVCS
Project description
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
grpc_svcs-0.1.2.tar.gz
(2.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file grpc_svcs-0.1.2.tar.gz.
File metadata
- Download URL: grpc_svcs-0.1.2.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acefd6558d8d36787d2d2a04fcdacfacee83f9db91b5d5b3a399dc9b3f456b1b
|
|
| MD5 |
77529f5cab05bd4809eea4a274cbda64
|
|
| BLAKE2b-256 |
c5a2d21669df3ed1e0d03f60617a77e35f2dd4f9eee705b74d22f485a040f61c
|
File details
Details for the file grpc_svcs-0.1.2-py3-none-any.whl.
File metadata
- Download URL: grpc_svcs-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7faa0abac0928b392a7a7320cfa4aac2c298717021e0c5a55764894045028032
|
|
| MD5 |
46564cd1eb15be3d03979ba59ce115fd
|
|
| BLAKE2b-256 |
f7c81f503aa1b0dbb253c8d7f33d1342f6b7926e593e83e0a2741a819473ab2d
|