Ploi API
Ploi API

Create queue worker

Creates a new queue worker in the server, preferably only used for Laravel driven applications. (This also includes frameworks or CMS's that use Laravel such as Statamic)

POST api/servers/{server}/sites/{id}/queues

Parameters

Parameter Type Status Description
connection string required
queue string required
maximum_seconds integer required Minimum: 0 Maximum: 60000
sleep integer required Minimum: 0 Maximum: 60000
processes integer required Minimum: 1 Maximum: 120
backoff integer required Minimum: 0
maximum_tries integer optional Minimum: 1 Maximum: 60000

Example request:

curl -X POST "https://ploi.io/api/servers/{server}/sites/{id}/queues" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data '{"connection":"database", "queue":"default", "maximum_seconds":"30", "sleep":"30", "processes":"2", "maximum_tries": "3"}'

Example response:

HTTP/1.1 201 CREATED
Content-Type: application/json

{
    "data": {
        "id": 1,
        "connection": "database",
        "queue": "default",
        "maximum_seconds": 30,
        "maximum_tries": null,
        "enviroment": null,
        "sleep": 10,
        "processes": 1,
        "backoff": 10,
        "status": "created",
        "site_id": 1,
        "server_id": 1
    }
}