aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-17 11:35:10 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:40:52 +0100
commitafffe98839db7ccbfa9fb8b7d1413b97900fdc73 (patch)
treef0b3cbe58f73e81a5ba4bb31dabd9691994cf2ca /server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts
parent1b3989b0961d22a5a45ad16239e3c3f58f66180c (diff)
downloadPeerTube-afffe98839db7ccbfa9fb8b7d1413b97900fdc73.tar.gz
PeerTube-afffe98839db7ccbfa9fb8b7d1413b97900fdc73.tar.zst
PeerTube-afffe98839db7ccbfa9fb8b7d1413b97900fdc73.zip
Speed up activity pub http requests
Diffstat (limited to 'server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts')
-rw-r--r--server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts b/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts
new file mode 100644
index 000000000..e4f6c94a5
--- /dev/null
+++ b/server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts
@@ -0,0 +1,23 @@
1import { JobScheduler, JobHandler } from '../job-scheduler'
2
3import * as activitypubHttpBroadcastHandler from './activitypub-http-broadcast-handler'
4import * as activitypubHttpUnicastHandler from './activitypub-http-unicast-handler'
5import { JobCategory } from '../../../../shared'
6
7type ActivityPubHttpPayload = {
8 uris: string[]
9 signatureAccountId: number
10 body: any
11}
12const jobHandlers: { [ handlerName: string ]: JobHandler<ActivityPubHttpPayload, void> } = {
13 activitypubHttpBroadcastHandler,
14 activitypubHttpUnicastHandler
15}
16const jobCategory: JobCategory = 'activitypub-http'
17
18const activitypubHttpJobScheduler = new JobScheduler(jobCategory, jobHandlers)
19
20export {
21 ActivityPubHttpPayload,
22 activitypubHttpJobScheduler
23}