Maxime d'Harboullé - 4AL1 - ESGI - 2021
Look at the console output while running
-
Launch the app
npm run start 3
with the specified number of workers you want(defaults to 4 if none) -
The producer and workers are initialized and connect to each other
-
Will watch for files in assets/files_watcher, send them to the workers via a message queue (zeroMQ). Then the fileWatcher will recieve messages of workers when the fake treatments are completed and then remove the files from the watcher.
-
Copy files in the watched directory
./assets/test_files
to ->./assets/files_watcher
, and they should be processed by the workers (in logs, files are found, file is recieved by the worker and then producer recieves message that the worker finished processing the file and deletes the file)
Note: the workers finish a task and gets a new one from the queue before the producer gets back the message from the worker syaing its done
npm install
npm start 4
(4 workers)
The argument is the number of workers you want (>= 1 and defaults to 4 if not or none is found)
App starts in index.ts
Copying all test files from ./assets/test_files
to ->./assets/files_watcher
when app is running
This test is set up with 4 workers