1
0
Fork 0
peertube/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts
2017-11-27 19:40:52 +01:00

23 lines
737 B
TypeScript

import { JobScheduler, JobHandler } from '../job-scheduler'
import * as activitypubHttpBroadcastHandler from './activitypub-http-broadcast-handler'
import * as activitypubHttpUnicastHandler from './activitypub-http-unicast-handler'
import { JobCategory } from '../../../../shared'
type ActivityPubHttpPayload = {
uris: string[]
signatureAccountId: number
body: any
}
const jobHandlers: { [ handlerName: string ]: JobHandler<ActivityPubHttpPayload, void> } = {
activitypubHttpBroadcastHandler,
activitypubHttpUnicastHandler
}
const jobCategory: JobCategory = 'activitypub-http'
const activitypubHttpJobScheduler = new JobScheduler(jobCategory, jobHandlers)
export {
ActivityPubHttpPayload,
activitypubHttpJobScheduler
}