Skip to content

serv-c/servc-python

Repository files navigation

servc-python

Serv-C implmentation for Python. Documentation can be found here

PyPI version Serv-C Serv-C Compliancy PyPI - Downloads Docker Pulls

Example

Here is the most simple example of use, starting a server to handle requests at the route my-route;

from typing import Any

from servc.server import start_server
from servc.svc.com.worker.types import RESOLVER_CONTEXT, RESOLVER_RETURN_TYPE

def inputProcessor(
  messageId: str,
  payload: Any,
  context: RESOLVER_CONTEXT,
) -> RESOLVER_RETURN_TYPE:
  return True

# the method 'methodA' will be resolved by inputProcessor
start_server(
  resolver={
    "methodA": inputProcessor
  }
)

About

Server implementation of serv-c framework in python

Topics

Resources

License

Stars

Watchers

Forks

Contributors 5