Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Start serving an asyncio.Server

Project description

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


$ pip install gera2ld-pyserve

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


Run an asynchronous function in an infinite event loop:

from gera2ld.pyserve import run_forever

async def main():
    # do stuff


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.

Files for gera2ld-pyserve, version 0.3.1
Filename, size File type Python version Upload date Hashes
Filename, size gera2ld_pyserve-0.3.1-py3-none-any.whl (3.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size gera2ld-pyserve-0.3.1.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page