summaryrefslogtreecommitdiffstats
path: root/src/tasks.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/tasks.ts')
-rw-r--r--src/tasks.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/tasks.ts b/src/tasks.ts
new file mode 100644
index 0000000..388dde8
--- /dev/null
+++ b/src/tasks.ts
@@ -0,0 +1,24 @@
+export interface InstagramTask {
+ type: "download_instagram";
+ url: string;
+ replyId: string;
+}
+
+export interface SlackReplyTask {
+ type: "slack_reply";
+ replyId: string;
+ message: string;
+ filePath: string;
+}
+
+export type Task = InstagramTask | SlackReplyTask;
+
+const taskQueue: Task[] = [];
+
+export const addTask = (task: Task) => {
+ taskQueue.push(task);
+};
+
+export const getTask = (): Task | undefined => {
+ return taskQueue.shift();
+};