2021-04-29 23:02:27 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { ParsedJob } from './types';
|
2021-04-29 23:02:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A single job instance. Shouldn't be instantiated directly, except by `JobQueue`.
|
|
|
|
*/
|
|
|
|
export class Job<T> implements ParsedJob<T> {
|
|
|
|
constructor(
|
|
|
|
readonly id: string,
|
|
|
|
readonly timestamp: number,
|
|
|
|
readonly queueType: string,
|
|
|
|
readonly data: T,
|
|
|
|
readonly completion: Promise<void>
|
|
|
|
) {}
|
|
|
|
}
|