Skip to content

Instantly share code, notes, and snippets.

View hheimbuerger's full-sized avatar

Henrik Heimbuerger hheimbuerger

View GitHub Profile
@hheimbuerger
hheimbuerger / flask_concurrent_blocking_initialization_example.py
Last active April 19, 2023 22:31
Flask app with long-running startup code, that blocks incoming requests until initialization is complete
import concurrent.futures
from functools import wraps
from flask import Flask
data = None
def long_running_initialization():
# Long running initialization code goes here