Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Scheduler Laravel Package

abc/scheduler

Experimental PHP scheduler library for running jobs based on CRON expressions. Define schedule providers and processors via simple interfaces, bind them in a Scheduler, and execute due schedules with an included Symfony Console command (abc:schedule).

View on GitHub
Deep Wiki
Context7

php-scheduler

A PHP library to process schedules base on CRON expressions.

Features:

  • Define schedules based on CRON expressions
  • Symfony Console Command to run scheduler
  • Simple integration by implementing two interfaces

Build Status

Note: This project is still experimental!

Installation

composer require abc/scheduler

Getting Started

  1. Define a schedule provider by implementing ProviderInterfacve.

    namespace Abc\Scheduler;
    
    interface ProviderInterface
    {
        /**
         * @return string The provider's name, used to bind a provider to processors
         */
        public function getName(): string;
    
        /**
         * @param int|null $limit
         * @param int|null $offset
         * @return ScheduleInterface[]
         */
        public function provideSchedules(int $limit = null, int $offset = null): array;
    
        public function save(ScheduleInterface $schedule): void;
    }
    
  2. Define a schedule processor by implementing ProcessorInterface.

    namespace Abc\Scheduler;
    
    /**
     * Process a schedule that is due.
     */
    interface ProcessorInterface
    {
        public function process(ScheduleInterface $schedule);
    }
    
  3. Bind Processor to Provider and initialize the ScheduleCommand

    use Abc\Scheduler\Scheduler;
    use Abc\Scheduler\Symfony\ScheduleCommand;
    
    $myProvider = new MyProvider();
    $myProcessor = new MyProcessor();
    
    $scheduler = new Scheduler();
    $scheduler->bind($myProvider, $myProcessor);
    
    $command = new ScheduleCommand($scheduler);
    
  4. Run the command

    bin/console abc:schedule
    

License

The MIT License (MIT). Please see License File for more information.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky