Skip to content

Instantly share code, notes, and snippets.

Avatar

Nikita Ilyasov hexrain

View GitHub Profile
@hexrain
hexrain / service.py
Created Jul 23, 2019
Server example
View service.py
import asyncio
import ssl
async def handle_echo(reader, writer):
data = await reader.read(100)
message = data.decode()
addr = writer.get_extra_info('peername')
print("Received %r from %r" % (message, addr))
print("Send: %r" % message)
@hexrain
hexrain / web_service.py
Created Jun 12, 2019
Simplest web service that can kill pgbouncer
View web_service.py
import asyncio
import argparse
import functools
import uuid
import aiohttp.web
import asyncpg
import uvloop