Skip to main content

Server implmentation of services for python

Project description

servc-python

Serv-C implmentation for Python. Documentation can be found https://docs.servc.io

PyPI version Serv-C 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, List

from servc.svc import Middleware
from servc.server import start_server
from servc.svc.com.bus import BusComponent
from servc.svc.com.cache import CacheComponent
from servc.svc.com.worker.types import EMIT_EVENT, RESOLVER_RETURN_TYPE

def inputProcessor(
  messageId: str,
  bus: BusComponent,
  cache: CacheComponent,
  payload: Any,
  components: List[Middleware],
  emitEvent: EMIT_EVENT,
) -> RESOLVER_RETURN_TYPE:
  return True

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

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

servc-1.5.4.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

servc-1.5.4-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file servc-1.5.4.tar.gz.

File metadata

  • Download URL: servc-1.5.4.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for servc-1.5.4.tar.gz
Algorithm Hash digest
SHA256 819ece706c0affe649665c95a8fe51cd27872ac99800bba9039c7bd2dfd153cc
MD5 1cc3294897a49cd9c20e2fcee8d141a9
BLAKE2b-256 550448d8c34b1aaa541ee975b51c3a43f71745ed3476bd00360f82056af6edae

See more details on using hashes here.

File details

Details for the file servc-1.5.4-py3-none-any.whl.

File metadata

  • Download URL: servc-1.5.4-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for servc-1.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6a6f3abfa7d1d77ebe039d00426aa6667c2aeedf4099c72145460ffa21a2c5d8
MD5 2a450eace6698577341684d092c2b843
BLAKE2b-256 aef531eda3fea0ef5b942dd5790fc4ceb385447d9b53b7724434b84c3ea6a495

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page