Skip to content

Commit

Permalink
feat(queue): return the pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
M.C. van den Boogaart committed Jun 25, 2021
1 parent f3d6839 commit 8d997fd
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/server/helpers/queue/task-runner.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import type { Database, UpdateResult } from '../sql'
import type { DuplexOptions, Readable, Transform, Writable } from 'stream'
import type { Queue, QueueRun, TaskRun } from '../../entities'
import Ajv from 'ajv'
import type { DuplexOptions } from 'stream'
import type { Logger } from 'pino'
import type { ObjectSchema } from 'fluent-json-schema'
import type { Queuer } from './queuer'
import type { WrappedNodeRedisClient } from 'handy-redis'
import { createNodeRedisClient } from 'handy-redis'
import type { queue as fastq } from 'fastq'
import { pipeline } from '../stream'
import { promise } from 'fastq'
import { sql } from '../sql'
import waitUntil from 'async-wait-until'
Expand Down Expand Up @@ -261,6 +262,16 @@ export abstract class TaskRunner {
return validator
}

/**
* Handles a data stream as a Promise.
*
* @param streams - The streams
* @see {@link pipeline}
*/
public async pipeline (...streams: Array<Readable | Transform | Writable>): Promise<void> {
return pipeline(...streams)
}

/**
* Sets up the task runner.
*
Expand Down

0 comments on commit 8d997fd

Please sign in to comment.