1
0
Fork 0
peertube/server/lib/jobs/transcoding-job-scheduler/transcoding-job-scheduler.ts
2017-11-27 19:40:51 +01:00

22 lines
728 B
TypeScript

import { JobCategory } from '../../../../shared'
import { JobHandler, JobScheduler } from '../job-scheduler'
import * as videoFileOptimizer from './video-file-optimizer-handler'
import * as videoFileTranscoder from './video-file-transcoder-handler'
import { VideoInstance } from '../../../models/video/video-interface'
type TranscodingJobPayload = {
videoUUID: string
resolution?: number
}
const jobHandlers: { [ handlerName: string ]: JobHandler<TranscodingJobPayload, VideoInstance> } = {
videoFileOptimizer,
videoFileTranscoder
}
const jobCategory: JobCategory = 'transcoding'
const transcodingJobScheduler = new JobScheduler(jobCategory, jobHandlers)
export {
TranscodingJobPayload,
transcodingJobScheduler
}