From 74dd33811e8488472ef8a53470ba6952364671db Mon Sep 17 00:00:00 2001 From: Piotr Smaron Date: Wed, 22 Apr 2026 10:15:09 +0200 Subject: [PATCH] storage_service: prepare for async gate in REST handlers Add hold_async_gate() public accessor for use by the REST registration layer in a followup commit. Convert run_with_no_api_lock to a coroutine so a followup commit can hold the async gate across the entire forwarded operation. No functional changes. --- service/storage_service.hh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/service/storage_service.hh b/service/storage_service.hh index abe38e0ff2..57dbd72622 100644 --- a/service/storage_service.hh +++ b/service/storage_service.hh @@ -794,6 +794,10 @@ private: public: int32_t get_exception_count(); + auto hold_async_gate() { + return _async_gate.hold(); + } + template auto run_with_api_lock(sstring operation, Func&& func) { return container().invoke_on(0, [operation = std::move(operation), @@ -804,8 +808,9 @@ public: template auto run_with_no_api_lock(Func&& func) { - return container().invoke_on(0, [func = std::forward(func)] (storage_service& ss) mutable { - return func(ss); + return container().invoke_on(0, [func = std::forward(func)] (storage_service& ss) mutable + -> futurize_t> { + co_return co_await futurize_invoke(func, ss); }); }