aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/jobs/http-request-job-scheduler/http-request-job-scheduler.ts
blob: ad33498667fcf69203ee6b3ff9cbe4182c06b4b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { JobScheduler, JobHandler } from '../job-scheduler'

import * as httpRequestBroadcastHandler from './http-request-broadcast-handler'
import * as httpRequestUnicastHandler from './http-request-unicast-handler'
import { JobCategory } from '../../../../shared'

type HTTPRequestPayload = {
  uris: string[]
  body: any
}
const jobHandlers: { [ handlerName: string ]: JobHandler<HTTPRequestPayload, void> } = {
  httpRequestBroadcastHandler,
  httpRequestUnicastHandler
}
const jobCategory: JobCategory = 'http-request'

const httpRequestJobScheduler = new JobScheduler(jobCategory, jobHandlers)

export {
  HTTPRequestPayload,
  httpRequestJobScheduler
}