aboutsummaryrefslogblamecommitdiffhomepage
path: root/server/lib/jobs/handlers/index.ts
blob: cef1f89a90e5c66cd53c7b954b02dd533d31d016 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                                                              
 
                                
                                          

                                         


                                                                   

                     




             
import * as videoFileOptimizer from './video-file-optimizer'
import * as videoFileTranscoder from './video-file-transcoder'

export interface JobHandler<T> {
  process (data: object, jobId: number): T
  onError (err: Error, jobId: number)
  onSuccess (jobId: number, jobResult: T)
}

const jobHandlers: { [ handlerName: string ]: JobHandler<any> } = {
  videoFileOptimizer,
  videoFileTranscoder
}

export {
  jobHandlers
}