Skip to content

利用信号控制php常驻进程平滑中断思考 - 麦田麦穗 #21

@visonforcoding

Description

@visonforcoding

https://visonforcoding.github.io/2020/05/30/php%E5%B8%B8%E9%A9%BB%E8%BF%9B%E7%A8%8B%E5%B9%B3%E6%BB%91%E4%B8%AD%E6%96%AD/

很多场景下我们都需要进程程序在后台一直处理任务,比如队列消费。可采用while true的方式让进程常驻按一定的频次执行任务。但是但我们要重启进程或中止进程时,如何保证进程内正在执行的任务执行完毕再中止呢?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions