aiohttp plugin for buvar
Project description
Solves some boilerplate around starting an aiohttp server.
import aiohttp.web
from buvar import context, di, fork, plugin
from buvar_aiohttp import AioHttpConfig
async def hello(request):
return aiohttp.web.Response(body=b"Hello, world")
async def prepare_aiohttp(load: plugin.Loader):
# provide config
context.add(AioHttpConfig(host="0.0.0.0", port=5678))
# prepare server site
await load("buvar_aiohttp")
# mount routes
app = await di.nject(aiohttp.web.Application)
app.router.add_route("GET", "/", hello)
# start a process for each available CPU and provide a shared socket to all
# children
fork.stage(prepare_aiohttp, forks=0, sockets=["tcp://:5678"])
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
buvar_aiohttp-0.5.2.tar.gz
(5.7 kB
view details)
File details
Details for the file buvar_aiohttp-0.5.2.tar.gz.
File metadata
- Download URL: buvar_aiohttp-0.5.2.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c43c88bc7bf5430eb3ed258647dbbc682f57a34fb9e2f465ba564596bc7ab4b
|
|
| MD5 |
4362997b22a2aba08bf2f0a3c2001c03
|
|
| BLAKE2b-256 |
ff2ba4d9ea1eec179ec01eeeab0075cb86401dba75df83f6cf0ccbce54f126b2
|
Provenance
The following attestation bundles were made for buvar_aiohttp-0.5.2.tar.gz:
Publisher:
package.yaml on diefans/buvar_aiohttp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
buvar_aiohttp-0.5.2.tar.gz -
Subject digest:
1c43c88bc7bf5430eb3ed258647dbbc682f57a34fb9e2f465ba564596bc7ab4b - Sigstore transparency entry: 394166644
- Sigstore integration time:
-
Permalink:
diefans/buvar_aiohttp@76205dc7d5ce4aa0cd3d1a8ecddcbae4b998a6c8 -
Branch / Tag:
refs/tags/0.5.2 - Owner: https://github.com/diefans
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
package.yaml@76205dc7d5ce4aa0cd3d1a8ecddcbae4b998a6c8 -
Trigger Event:
release
-
Statement type: