From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox Datacenter Manager development discussion
<pdm-devel@lists.proxmox.com>,
Dominik Csapak <d.csapak@proxmox.com>
Subject: Re: [pdm-devel] [PATCH datacenter-manager v2] ui: resource tree: use AsyncAbortGuard to cancel obsolete pending loads
Date: Tue, 22 Apr 2025 22:13:26 +0200 [thread overview]
Message-ID: <38c1738b-3e44-4948-b4ff-99c317cf5d83@proxmox.com> (raw)
In-Reply-To: <20250418074647.1057147-1-d.csapak@proxmox.com>
Am 18.04.25 um 09:46 schrieb Dominik Csapak:
> Currently, if a new serach term is given, a new load will occur if the
> INPUT_BUFFER_MS time is reached. Any old in-flight API requests are not
> canceled, and might still arrive.
>
> To prevent that, use an AsyncAbortGuard so the old load will be aborted
> whenever it is overwritten.
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> changes from v1:
> * use AsyncAbortGuard instead of AsyncPool, since that's the correct
> abstraction here.
> * introduce a new Msg variant, so that we can overwrite the AsyncAbortGuard
> in the update method
>
> replaces:
> https://lore.proxmox.com/pdm-devel/20250416113232.2488103-1-d.csapak@proxmox.com/
Yeah, this reads a bit nicer and more convenient.
> ui/src/widget/resource_tree.rs | 28 +++++++++++++++++++---------
> 1 file changed, 19 insertions(+), 9 deletions(-)
>
> @@ -88,6 +89,7 @@ async fn load_resources(search_term: String) -> Result<Vec<RemoteResources>, Err
> }
>
> pub enum Msg {
> + LoadRequest,
Tiny nit: would it be a tiny bit more and telling and consistent with pwt if we
would name this message "UpdateFilter"? E.g. like PwtSearchDropdown uses.
Could be adapted on applying though.
> Load,
> LoadResult(Result<Vec<RemoteResources>, Error>),
> RemoteListChanged(RemoteList),
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
next prev parent reply other threads:[~2025-04-22 20:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-18 7:46 Dominik Csapak
2025-04-22 20:13 ` Thomas Lamprecht [this message]
2025-04-23 6:49 ` Dominik Csapak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=38c1738b-3e44-4948-b4ff-99c317cf5d83@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=d.csapak@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal