From 59a7470853957d6055c120e9bf8658b4b7b48879 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Fri, 13 Mar 2020 15:50:58 +0100 Subject: feat: Add infrastructure for failures --- .../atlarge/opendc/core/failure/FailureDomain.kt | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/failure/FailureDomain.kt (limited to 'opendc/opendc-core/src') diff --git a/opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/failure/FailureDomain.kt b/opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/failure/FailureDomain.kt new file mode 100644 index 00000000..b1c7ccd3 --- /dev/null +++ b/opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/failure/FailureDomain.kt @@ -0,0 +1,35 @@ +/* + * MIT License + * + * Copyright (c) 2020 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.atlarge.opendc.core.failure + +/** + * A logical or physical component in a computing environment which may fail. + */ +public interface FailureDomain { + /** + * Fail the domain externally. + */ + public suspend fun fail() +} -- cgit v1.2.3