Skip to content

TaskView is a self-hosted project and task management platform focused on clarity, ownership, and control. TaskView is built for teams that want a transparent, self-hosted alternative to SaaS task managers.

1.5 KB
Raw Blame
import { startJobQueue } from './JobQueue';
import type { Dispatcher } from './Dispatcher';
import { NotificationDispatcher } from '../tv-modules/notifications/NotificationDispatcher';
import { RealtimeDispatcher } from '../tv-modules/realtime/RealtimeDispatcher';
import { WebhooksDispatcher } from '../tv-modules/webhooks/WebhooksDispatcher';
import { TimeTrackingDispatcher } from '../tv-modules/time-tracking/TimeTrackingDispatcher';
import { SprintsDispatcher } from '../tv-modules/sprints/SprintsDispatcher';
import { RecurrenceDispatcher } from '../tv-modules/recurrence/RecurrenceDispatcher';
import { MessagingDispatcher } from '../tv-modules/messaging/MessagingDispatcher';
import { InviteEmailDispatcher } from '../tv-modules/collaboration/InviteEmailDispatcher';
import { FilesDispatcher } from '../tv-modules/files/FilesDispatcher';
import { AutomationsDispatcher } from '../tv-modules/automations/AutomationsDispatcher';

const dispatchers: Dispatcher[] = [
    new NotificationDispatcher(),
    new RealtimeDispatcher(),
    new WebhooksDispatcher(),
    new TimeTrackingDispatcher(),
    new SprintsDispatcher(),
    new RecurrenceDispatcher(),
    new MessagingDispatcher(),
    new InviteEmailDispatcher(),
    new FilesDispatcher(),
    new AutomationsDispatcher(),
];

export function registerAllEventHandlers() {
    dispatchers.forEach((d) => d.register());
}

export async function startAllWorkers() {
    await startJobQueue();
    for (const d of dispatchers) {
        await d.registerWorkers();
    }
}