Skip to main content

Start serving an asyncio.Server

Project description

https://img.shields.io/pypi/v/gera2ld-pyserve.svg

Serve asyncio and aiohttp servers, and show information for development.

Installation

$ pip install gera2ld-pyserve

# or with extra `aio` if aiohttp applications are to be served
$ pip install gera2ld-pyserve[aio]

Usage

Run an asynchronous function in an infinite event loop:

from gera2ld.pyserve import run_forever

async def main():
    # do stuff

run_forever(main())

Start a server:

from gera2ld.pyserve import run_forever, start_server_asyncio

def handle(reader, writer):
    # add more code here...

run_forever(start_server_asyncio(handle, ':4000'))

Start a server with aiohttp:

from gera2ld.pyserve import run_forever, start_server_aiohttp
from aiohttp import web

app = web.Application()
# add more code here...

run_forever(start_server_aiohttp(app, ':4000'))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gera2ld-pyserve-0.3.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

gera2ld_pyserve-0.3.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file gera2ld-pyserve-0.3.1.tar.gz.

File metadata

  • Download URL: gera2ld-pyserve-0.3.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.9 CPython/3.8.3 Darwin/19.5.0

File hashes

Hashes for gera2ld-pyserve-0.3.1.tar.gz
Algorithm Hash digest
SHA256 a5bb81a3a18f122aa7a72a6e1f1ef604fa356013d6135598bfebdceccbdf43bd
MD5 3ed65287bcdd0ef60e1e278c1425302f
BLAKE2b-256 4d5e418d620ab89847fb66a2e45f883325435a30717b4a180457e80e32b34d62

See more details on using hashes here.

File details

Details for the file gera2ld_pyserve-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: gera2ld_pyserve-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.9 CPython/3.8.3 Darwin/19.5.0

File hashes

Hashes for gera2ld_pyserve-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c54204388e7f74a28ed649a6c5f8ffa06ab749913659f669f322492f0a683c95
MD5 843f2e20874e6074a26f808e5df5ff9d
BLAKE2b-256 c8a666f9d53da97e97748500f938db44e87312ccc8ab8f8dce6756d584f8468f

See more details on using hashes here.

Supported by

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