What is a worker
When a user wants to upload a photo, it is sent to a queue. A good visualization of this is a
fast food restaurant.
-
Each order is like a
queue job.
-
Each order needs a worker to fulfill it,
so it will sit in the queue until a worker picks it up.
-
Think of the queue as a line, so each job
will wait till it is at the front to be picked up.
-
When a worker picks up a job, it will asynchronously process it alongside other workers.
- This means if we have 5 workers, we can handle 5 orders at the same time
- asynchronous = at the same time
In our case...
- We use workers to handle uploading images to the AWS S3.
- Using a Database, we can track the progress of the image as it is sitting in the queue and being processed.