Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Prediction is very difficult, especially of the future. -- Niels Bohr


devel / comp.lang.python / Re: Using a background thread with asyncio/futures with flask

SubjectAuthor
o Re: Using a background thread with asyncio/futures with flaskChris Angelico

1
Re: Using a background thread with asyncio/futures with flask

<mailman.6.1711094315.3468.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=29714&group=comp.lang.python#29714

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: rosuav@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: Using a background thread with asyncio/futures with flask
Date: Fri, 22 Mar 2024 18:58:20 +1100
Lines: 15
Message-ID: <mailman.6.1711094315.3468.python-list@python.org>
References: <8a7231df-c30c-4fa6-9daa-546b3453b547@thomasnyberg.com>
<09efe843-195e-48c0-a9cb-6fe05e3a6921@solute.de>
<CAPTjJmrkOwDhYi1NEHuKRTm4qhe=hYbGJiiZifZ5h7xjOz00Eg@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de k3jXSIPsEVyFow3Mhh+mYALmRQnLPv6d373dF/3YIieg==
Cancel-Lock: sha1:EP4lXnIIXC6giXVs+d6/x18fJy0= sha256:UOJKDowCOAmCaRBoCdfUR23OSy0VcE2J/R5xoXRiRCo=
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=aXnrSvW7;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.007
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'searching': 0.05; 'e.g.':
0.07; 'mar': 0.07; 'that.': 0.15; '2024': 0.16; 'chrisa': 0.16;
'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16;
'similar.': 0.16; 'subject:thread': 0.16; 'wrote:': 0.16; 'to:addr
:python-list': 0.20; 'written': 0.22; 'fri,': 0.22; 'maybe': 0.22;
'flask': 0.26; 'old': 0.27; 'python-list': 0.32; 'subject:Using':
0.32; 'message-id:@mail.gmail.com': 0.32; 'but': 0.32; 'someone':
0.34; 'header:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'url-ip:104.17/16': 0.35; 'from:addr:gmail.com': 0.35;
'received:209.85': 0.37; 'received:209': 0.39;
'received:209.85.208': 0.39; 'use': 0.39; 'try': 0.40; 'asyncio.':
0.84; 'url:x': 0.93
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1711094312; x=1711699112; darn=python.org;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:from:to:cc:subject:date:message-id:reply-to;
bh=GGO1HMx7T4Ydml3zQOk3ikxR1zVRI9NA3H43veIy3Cg=;
b=aXnrSvW7tbLXqDeq7OEzUrlw4F4VvEN5IRPSQTyRw3Xl1chLjoKFcNf0PPiQrf423Z
mxoMsubsDnbYda3pIrYqzRbK9EXDpi1xTzFpHm+IrHfP4eO5vIOWUNCHWj8rOXKfHZii
skeUv3B4M5Fgw2nY3a/3Tkm09sFuHZVrR/HFo2M+WTMtWT1LNvqN5WlPfpnoh+Tyd2yu
8GRL3Et5Yr4TlJ3GTv5it/zQB8Q6by1oH0I/RRJasGNH2TkXP6sqz18c7TqE+Ta4jiJ1
kfqdOHict6AayxdGP3fEFT6mn3s6OpAVIktdizeMS222PSzg4esbD2c4LxediivDhL/z
1t3w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1711094312; x=1711699112;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
bh=GGO1HMx7T4Ydml3zQOk3ikxR1zVRI9NA3H43veIy3Cg=;
b=uZz1znTPA5I87V9Mwo07NhsuBGuq4nrzpJsGdifC0ZlhALmLAg6w+pukR1X29FmbKn
7SalLgilTBomCTdaj1hk2RsPMEmbyvPU1HINU573//SL452i0rzIlYlpdeQyrN8kwKbn
c8wRhnEpICYLvgAL4ssA/kfGv9Tb0VZpn2oU4szEw6eHHHW+lwh7zrU1eWULg2HCbTkD
VzavyDizvmWzPwGp+k1RE9I6a9H4gFofEgKAbBSVn3F/ARDtVpkJHfFjDpqoN0QrBheY
I1KNBybF56cYJV/4o4isJBhGpsX1A8jvV3jvSH+Xv0dGVqVJB+PhwjNIWXLYOyqP7HCJ
6Zsw==
X-Gm-Message-State: AOJu0YzC9KQrnnTe6zumEYicKL777Il+Mxy08rvgF6frZvH3OoUiauxO
GVPc6Q6AiptElRknNaY9mAs6arUZ0lAUQwyTyRP5h3KnJ66vZ6dFDPdcQd1Yvx5tuvUOmQBknKr
Ybx57X6zNT6GnI3VnVZnLcGuGCnskvbVtWZI=
X-Google-Smtp-Source: AGHT+IGqtEDFq7gT+z7CneMg4IXp3k81uvFQBDAr/NsrO05f/3S65miHY81iYxJRSuTDvKVfxXAbidcipjBKle/LWgc=
X-Received: by 2002:a05:6512:92c:b0:515:9185:652f with SMTP id
f12-20020a056512092c00b005159185652fmr992314lft.33.1711094311953; Fri, 22 Mar
2024 00:58:31 -0700 (PDT)
In-Reply-To: <09efe843-195e-48c0-a9cb-6fe05e3a6921@solute.de>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAPTjJmrkOwDhYi1NEHuKRTm4qhe=hYbGJiiZifZ5h7xjOz00Eg@mail.gmail.com>
X-Mailman-Original-References: <8a7231df-c30c-4fa6-9daa-546b3453b547@thomasnyberg.com>
<09efe843-195e-48c0-a9cb-6fe05e3a6921@solute.de>
 by: Chris Angelico - Fri, 22 Mar 2024 07:58 UTC

On Fri, 22 Mar 2024 at 18:35, Lars Liedtke via Python-list
<python-list@python.org> wrote:
>
> Hey,
>
> As far as I know (might be old news) flask does not support asyncio.
>
> You would have to use a different framework, like e.g. FastAPI or similar. Maybe someone has already written "flask with asyncio" but I don't know about that.
>

Did you try searching their documentation?

https://flask.palletsprojects.com/en/3.0.x/async-await/

ChrisA

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor