承接 pogo/scheduler 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pogo/scheduler

最新稳定版本:v0.0.2

Composer 安装命令:

composer require pogo/scheduler

包简介

Pogo Native Scheduler for Laravel

README 文档

README

A Caddy / FrankenPHP module that can replace the system crond in some scenarios.

It runs a lightweight Go ticker and executes a configurable command (e.g. php artisan schedule:run) every minute, aligned to the wall clock.

Installation

1. Get the Binary

You have two options to get FrankenPHP with the scheduler module enabled:

Option A: Pre-built Binary or Docker (Recommended)

You can use the pre-compiled binaries or Docker images that already include the scheduler module.

Option B: Compile from Source

If you prefer to build it yourself, follow the instructions to install a ZTS version of libphp and xcaddy. Then, use xcaddy to build FrankenPHP with the pogo-scheduler module:

CGO_ENABLED=1 \
CGO_CFLAGS=$(php-config --includes) \
CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" \
xcaddy build \
    --output frankenphp \
    --with github.com/y-l-g/scheduler/module \
    --with github.com/dunglas/frankenphp/caddy \
    --with github.com/dunglas/caddy-cbrotli

2. Configure Caddyfile

Add a pogo_scheduler block to your Caddyfile. Example for Laravel:

{
    pogo_scheduler {
        command php artisan schedule:run
        dir     /var/www/html
        timeout 5m
    }
}
  • command: command to run every minute (default: php artisan schedule:run).
  • dir: working directory for the command (optional).
  • timeout: max duration per run (default: 5m).

3. Run Octane

Start the server using the configured Caddyfile:

php artisan octane:frankenphp --caddyfile=Caddyfile
# or
./frankenphp run 

How It Works

  1. The Ticker (Go): A goroutine wakes up every 60 seconds, aligned to the start of each minute (:00).
  2. The Command: At each tick, the module runs the configured command in a subprocess (e.g. php artisan schedule:run).
  3. Timeout: Each run is bounded by the configured timeout; the process is killed if it exceeds it.

Concurrency Note

Each tick runs the command in a new process. If a run lasts longer than one minute, the next tick will start another process, so runs can overlap. To avoid that, set a timeout shorter than 60s or ensure your scheduled tasks finish within a minute.

统计信息

  • 总下载量: 24
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: Go

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固