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

18 lines
491 B
TypeScript
Raw Normal View History

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