aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/jobs/handlers/index.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-06-10 22:15:25 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-06-10 22:15:25 +0200
commit69818c9394366b954b6ba3bd697bd9d2b09f2a16 (patch)
treead199a18ec3c322460d6f9523fc383ee562554e0 /server/lib/jobs/handlers/index.ts
parent4d4e5cd4dca78480ec7f40e747f424cd107376a4 (diff)
downloadPeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.tar.gz
PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.tar.zst
PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.zip
Type functions
Diffstat (limited to 'server/lib/jobs/handlers/index.ts')
-rw-r--r--server/lib/jobs/handlers/index.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/lib/jobs/handlers/index.ts b/server/lib/jobs/handlers/index.ts
index ae5440031..7d0263b15 100644
--- a/server/lib/jobs/handlers/index.ts
+++ b/server/lib/jobs/handlers/index.ts
@@ -1,6 +1,14 @@
1import * as videoTranscoder from './video-transcoder' 1import * as videoTranscoder from './video-transcoder'
2 2
3const jobHandlers = { 3import { VideoInstance } from '../../../models'
4
5export interface JobHandler<T> {
6 process (data: object, callback: (err: Error, videoInstance?: T) => void)
7 onError (err: Error, jobId: number, video: T, callback: (err: Error) => void)
8 onSuccess (data: any, jobId: number, video: T, callback: (err: Error) => void)
9}
10
11const jobHandlers: { [ handlerName: string ]: JobHandler<any> } = {
4 videoTranscoder 12 videoTranscoder
5} 13}
6 14