From: Casey Bodley Date: Tue, 30 Apr 2024 19:29:27 +0000 (-0400) Subject: common/async: add cancel_on_error enum X-Git-Tag: v20.0.0~1873^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e4d5b4e937b03e72356c21cdf9b4d24459080c35;p=ceph.git common/async: add cancel_on_error enum Signed-off-by: Casey Bodley --- diff --git a/src/common/async/cancel_on_error.h b/src/common/async/cancel_on_error.h new file mode 100644 index 00000000000..fd3752d2f82 --- /dev/null +++ b/src/common/async/cancel_on_error.h @@ -0,0 +1,29 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab ft=cpp + +/* + * Ceph - scalable distributed file system + * + * Copyright contributors to the Ceph project + * + * This is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software + * Foundation. See file COPYING. + * + */ + +#pragma once + +#include + +namespace ceph::async { + +/// Error handling strategy for concurrent operations. +enum class cancel_on_error : uint8_t { + none, //< No spawned coroutines are canceled on failure. + after, //< Cancel coroutines spawned after the failed coroutine. + all, //< Cancel all spawned coroutines on failure. +}; + +} // namespace ceph::async