]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/async: add cancel_on_error enum
authorCasey Bodley <cbodley@redhat.com>
Tue, 30 Apr 2024 19:29:27 +0000 (15:29 -0400)
committerCasey Bodley <cbodley@redhat.com>
Wed, 22 May 2024 17:58:54 +0000 (13:58 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/common/async/cancel_on_error.h [new file with mode: 0644]

diff --git a/src/common/async/cancel_on_error.h b/src/common/async/cancel_on_error.h
new file mode 100644 (file)
index 0000000..fd3752d
--- /dev/null
@@ -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 <cstdint>
+
+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