This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import http | |
import logging | |
# import random | |
import socketserver | |
import threading | |
# import time | |
import wsgiref.simple_server | |
import falcon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import aioboto3 | |
import falcon.asgi | |
logging.basicConfig( | |
format='%(asctime)s [%(levelname)s] %(message)s', level=logging.INFO | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import aiohttp | |
import falcon | |
import falcon.asgi | |
# NOTE(vytas): Useful since ASGI otherwise has nothing like wsgierrors. | |
logging.basicConfig( | |
format='%(asctime)s [%(levelname)s] %(message)s', level=logging.INFO) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cgi | |
import functools | |
import falcon | |
class TextHandler(falcon.media.BaseHandler): | |
DEFAULT_CHARSET = 'utf-8' | |
@classmethod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import asyncio | |
import logging | |
import threading | |
import uuid | |
import falcon | |
import falcon.asgi | |
import gunicorn.app.base | |
import uvicorn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import falcon.asgi | |
import httpx | |
class Proxy(object): | |
UPSTREAM = 'https://falconframework.org' | |
def __init__(self): | |
self._client = httpx.AsyncClient() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import time | |
import uuid | |
import falcon | |
class RequestMonitor: | |
def __init__(self, req, resp): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import falcon | |
import falcon.routing | |
class FloatConverter(falcon.routing.BaseConverter): | |
def convert(self, value): | |
try: | |
return float(value) | |
except ValueError: | |
return None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Credit: @vytas7 (Vytautas Liuolia) | |
import queue | |
import signal | |
import threading | |
import time | |
import uuid | |
import falcon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# # docker run --rm -it -p 27017:27017 mongo | |
# $ gunicorn --workers 8 --worker-class=meinheld.gmeinheld.MeinheldWorker test:app | |
import itertools | |
import random | |
import falcon | |
import pymongo | |
NewerOlder