PHPackages                             pedhot-dev/prokerja - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. pedhot-dev/prokerja

ActiveLibrary[Queues &amp; Workers](/categories/queues)

pedhot-dev/prokerja
===================

A lightweight PHP job &amp; queue framework

0.1.0(4mo ago)00[1 issues](https://github.com/Pedhot-Dev/ProKerja/issues)Apache-2.0PHPPHP ^8

Since Jan 12Pushed 4mo agoCompare

[ Source](https://github.com/Pedhot-Dev/ProKerja)[ Packagist](https://packagist.org/packages/pedhot-dev/prokerja)[ RSS](/packages/pedhot-dev-prokerja/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

ProKerja
========

[](#prokerja)

**ProKerja** is a lightweight PHP job &amp; queue framework focused on **declaration-first task orchestration**.

It provides a clean, minimal, and transparent job queue system built on top of **PHP + SQLite + Symfony Console**, without relying on heavy frameworks, magic containers, or hidden execution layers.

ProKerja is designed to be:

- technically correct
- predictable
- framework-agnostic
- usable in real projects

Any interpretation beyond what the system explicitly guarantees is **outside its responsibility**.

---

Core Concept
------------

[](#core-concept)

ProKerja separates **declaration** from **realization**.

- Declaring a job means it is **registered into the system**
- Realizing a job depends entirely on **worker availability**
- The system **does not promise execution**, only orchestration

This is not a limitation.
This is the contract.

---

Features
--------

[](#features)

- Job declaration &amp; dispatch
- Persistent queue (SQLite)
- Long-running worker process
- Explicit job lifecycle:
    - `pending`
    - `processing`
    - `completed`
    - `failed`
- Symfony Console–based CLI
- Zero framework lock-in
- No background magic

---

Requirements
------------

[](#requirements)

- PHP 8.0+
- PDO with SQLite enabled
- Composer

---

Installation
------------

[](#installation)

```
git clone https://github.com/Pedhot-Dev/ProKerja.git
cd prokerja
composer install
chmod +x bin/prokerja or php bin/prokerja
```

Basic Usage
-----------

[](#basic-usage)

### 1. Declare Jobs via CLI

[](#1-declare-jobs-via-cli)

```
php bin/prokerja declare:job

```

This command will:

- create job entries
- store them in the queue
- return immediately

A successful declaration means:

- the job exists
- the job is persisted
- the system acknowledges it

It **does not** mean the job has been executed.

### 2. Start Worker (Realization Process)

[](#2-start-worker-realization-process)

```
php bin/prokerja realization:start

```

This starts a blocking worker process that:

- continuously checks the queue
- processes pending jobs
- updates job status

If the queue is empty, the worker will remain idle and wait.

### 3. View Queue Report

[](#3-view-queue-report)

```
php bin/prokerja report

```

Example output:

```
ProKerja Report
pending: 10
processing: 0
completed: 2
failed: 0

```

This report reflects **system state**, not execution guarantees.

Creating Your Own Job
---------------------

[](#creating-your-own-job)

### 1. Create a Job Class

[](#1-create-a-job-class)

All jobs must implement `JobInterface`.

```
