What is Beanstalkd?
Beanstalkd is a high-performance, lightweight distributed memory queue system
Basic concept
job: requires asynchronous processing Task (or message) is the basic unit in Beanstalkd
tube: pipe (or message queue), used to store jobs of the same type, and is the object of producer and consumer operations
producer: The producer of the job puts a job into a tube through the put command
consumer: The consumer of the job uses the reserve/release/bury/delete command to obtain the job or change the status of the job
job status
delayed:Delayed status
ready:To be read by the consumer status
reserved:Consumer processing status
buried: reserved status
delete: processing completed deletion status
Features
priority: priority, supports 0 to 2^ The priority of 32, the smaller the value, the higher the priority. The default priority is 1024
delay: delay, delayed consumption, used to implement scheduled tasks
Persistence: use binlog to combine jobs and Its status is recorded in the file. After Beanstalkd restarts or hangs up, the previous job and status can be restored by reading the binlog.
TTR: Timeout control. When putting a job, you can set the timeout. If the consumer cannot After the processing is completed within the TTR time, the job will be set to the ready state for other consumers to continue execution.
The above is the detailed content of Detailed explanation of Beanstalkd message/task queue. For more information, please follow other related articles on the PHP Chinese website!