From 8ede79bf4962b48a37301f6c8a227c244909d6fc Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Tue, 24 May 2022 19:20:39 +0200 Subject: [PATCH] Future: Add support for fixed descriptor IDs --- source/tasky/jobs.d | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/source/tasky/jobs.d b/source/tasky/jobs.d index 1b79692..b4ca9a3 100644 --- a/source/tasky/jobs.d +++ b/source/tasky/jobs.d @@ -81,6 +81,8 @@ public final class JobException : TaskyException * by a unique ID. Along with this is an associated * signal handler provided by the user which is * to be run on completion of said Job +* +* TODO: Add support for custom IDs */ public abstract class Descriptor : Signal { @@ -257,6 +259,26 @@ public abstract class Descriptor : Signal super([descriptorClass]); } + /** + * Creates a new Descriptor (with a given fixed descriptor class) + * + * TODO: Future support (add this in after TaskyEvent things) + */ + this(ulong descriptorClass) + { + /* TODO: Check if it is available */ + /* TODO: Add to queue */ + + /* Set the descriptor ID */ + this.descriptorClass = descriptorClass; + + /** + * Setup a new Eventy Signal handler + * which handles only the typeID + * of `descriptorClass` + */ + super([descriptorClass]); + } unittest