From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 11F091FF0B2 for ; Mon, 24 Aug 2026 15:13:42 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id D43D6215CC; Mon, 24 Aug 2026 15:13:41 +0200 (CEST) Content-Type: text/plain; charset=UTF-8 Date: Mon, 24 Aug 2026 15:13:38 +0200 Message-Id: To: "Robert Obkircher" , "Lukas Wagner" Subject: Re: [PATCH datacenter-manager 06/20] pdm-config: subscriptions: rename trait methods to read/write/lock From: "Lukas Wagner" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: aerc 0.21.0-0-g5549850facc2-dirty References: <20260817125727.454039-1-l.wagner@proxmox.com> <20260817125727.454039-7-l.wagner@proxmox.com> <178732083104.243770.4631361288224973083.b4-review@b4> In-Reply-To: <178732083104.243770.4631361288224973083.b4-review@b4> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787577189153 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.656 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: LIYVUDEDFDDT3I7YXRALILXXWJN76X73 X-Message-ID-Hash: LIYVUDEDFDDT3I7YXRALILXXWJN76X73 X-MailFrom: l.wagner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: pdm-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Fri Aug 21, 2026 at 4:00 PM CEST, Robert Obkircher wrote: >> PdmApplication bundles the client factory, remote config, subscription >> key config, and product config behind a single cloneable handle. This >> replaces the growing set of independent global statics with one object >> that can be assembled differently for production, the fake-remote >> feature, and integration tests. > > Bundling them is convenient, but the components could additionally be > registered individually, to allow for application independent methods. Yeah, I'm also not 100% sure about the best granularity here. For application-independent methods defined in shared crates it could also make sense to use specific context types that can be injected, e.g. if there is proxmox-foo that defines API handlers, there could be struct FooContext { product_config: ProductConfig, // that would be a clone of the one in P= dmApplication // ... and other stuff needed for proxmox-foo } and then the API handlers in proxmox-foo would take State as a state-arg. This might be preferable, since most likely the shared crate is going to need *some* kind of app-specific context anyway (for example, see the app-specific context in proxmox-notify [1]) [1] https://git.proxmox.com/?p=3Dproxmox.git;a=3Dblob;f=3Dproxmox-notify/sr= c/context/pve.rs;h=3D3d9ff92e9bf4688ce199ba68e72706ae3d1d6ae1;hb=3DHEAD#l32 > > e.g. State could work in PBS as well. That might be a > bad example though, becasue api_user and priv_user are used all over > the place and should maybe remain static [1]. > > I wonder if conditionally compiling to static variables for release > builds and tokio::task_local in tests would work there. >