A social knowledge tool for researchers built on ATProto
1import { configService } from './shared/infrastructure/config';
2import { AppProcess } from './shared/infrastructure/processes/AppProcess';
3import { FeedWorkerProcess } from './shared/infrastructure/processes/FeedWorkerProcess';
4import { InMemoryEventWorkerProcess } from './shared/infrastructure/processes/InMemoryEventWorkerProcess';
5
6async function main() {
7 const appProcess = new AppProcess(configService);
8
9 // Start the app process
10 await appProcess.start();
11
12 // Only start event worker in same process when using in-memory events
13 const useInMemoryEvents = configService.shouldUseInMemoryEvents();
14 if (useInMemoryEvents) {
15 console.log('Starting in-memory event worker in the same process...');
16 const inMemoryWorkerProcess = new InMemoryEventWorkerProcess(configService);
17 await inMemoryWorkerProcess.start();
18 } else {
19 console.log('Using external worker processes for event handling');
20 }
21}
22
23main().catch((error) => {
24 console.error('Failed to start application:', error);
25 process.exit(1);
26});