From afffe98839db7ccbfa9fb8b7d1413b97900fdc73 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 17 Nov 2017 11:35:10 +0100 Subject: Speed up activity pub http requests --- .../activitypub-http-job-scheduler.ts | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts (limited to 'server/lib/jobs/activitypub-http-job-scheduler/activitypub-http-job-scheduler.ts') 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 @@ +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 } = { + activitypubHttpBroadcastHandler, + activitypubHttpUnicastHandler +} +const jobCategory: JobCategory = 'activitypub-http' + +const activitypubHttpJobScheduler = new JobScheduler(jobCategory, jobHandlers) + +export { + ActivityPubHttpPayload, + activitypubHttpJobScheduler +} -- cgit v1.2.3