PeerTube/server/lib/jobs/handlers/index.ts

18 lines
409 B
TypeScript
Raw Normal View History

import * as videoFileOptimizer from './video-file-optimizer'
import * as videoFileTranscoder from './video-file-transcoder'
2017-05-15 15:22:03 -05:00
2017-06-10 15:15:25 -05:00
export interface JobHandler<T> {
process (data: object): T
onError (err: Error, jobId: number)
onSuccess (jobId: number, jobResult: T)
2017-06-10 15:15:25 -05:00
}
const jobHandlers: { [ handlerName: string ]: JobHandler<any> } = {
videoFileOptimizer,
videoFileTranscoder
2017-05-15 15:22:03 -05:00
}
export {
jobHandlers
}