From c27ffd428e5183d081e6729f11e857734f1b04a8 Mon Sep 17 00:00:00 2001 From: singularitti Date: Sat, 20 Jan 2024 23:43:17 -0500 Subject: [PATCH 1/2] Add SumTypes.jl to EasyJobsBase deps --- EasyJobsBase/Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/EasyJobsBase/Project.toml b/EasyJobsBase/Project.toml index 5bd5aeb..e3fecea 100644 --- a/EasyJobsBase/Project.toml +++ b/EasyJobsBase/Project.toml @@ -6,6 +6,7 @@ version = "0.15.0" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" +SumTypes = "8e1ec7a9-0e02-4297-b0fe-6433085c89f2" Thinkers = "6d80a3f9-a943-41fa-97b3-3004c0daf7a3" UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" From 2df9042efb8d3c1aff1de9e4a1c9c3354ea865b7 Mon Sep 17 00:00:00 2001 From: singularitti Date: Sat, 20 Jan 2024 23:43:32 -0500 Subject: [PATCH 2/2] Switch `JobStatus` from `Enum` to sum types --- EasyJobsBase/src/jobs.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/EasyJobsBase/src/jobs.jl b/EasyJobsBase/src/jobs.jl index 775411c..bcf4b00 100644 --- a/EasyJobsBase/src/jobs.jl +++ b/EasyJobsBase/src/jobs.jl @@ -1,11 +1,12 @@ using Dates: DateTime, now using UUIDs: UUID, uuid1 +using SumTypes: @sum_type using Thinkers: Think export Job, IndependentJob, ConditionalJob, ArgDependentJob -@enum JobStatus begin +@sum_type JobStatus begin PENDING RUNNING SUCCEEDED