aboutsummaryrefslogblamecommitdiffhomepage
path: root/server/lib/jobs/transcoding-job-scheduler/transcoding-job-scheduler.ts
blob: c5efe8eeb174e0fe9977872342a4cac033cbb61d (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11

                                                           

                                                                      
                                                                     
 




                                                                                                    







                                                                          
                        

                         
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
}