Offload tasks to a pool of workers on node.js and in the browser
Overall
score
95%
Create a worker pool system that processes large image buffers efficiently using parallel workers.
You need to build a system that can process multiple large image buffers in parallel. Each image is represented as a raw RGBA pixel buffer (4 bytes per pixel). The processing involves applying a brightness adjustment to each pixel in the image.
Your system should:
Create a main application that:
Create a worker script that:
processBrightness function that takes an image buffer and brightness deltaInput:
Expected Output:
Input:
Expected Output:
Input:
Expected Behavior:
Your implementation should log:
Processing image 1 (1920x1080)...
Processing image 2 (1920x1080)...
Image 1 completed
Image 2 completed
All images processed successfullyProvides worker pool functionality for parallel task execution.
Main application that creates the worker pool and processes images.
Worker script that implements the image brightness processing logic.
Test suite that validates the image processing functionality.
Install with Tessl CLI
npx tessl i tessl/npm-workerpoolevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10