Download the PHP package biigle/laravel-remote-queue without Composer
On this page you can find all versions of the php package biigle/laravel-remote-queue. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download biigle/laravel-remote-queue
More information about biigle/laravel-remote-queue
Files in biigle/laravel-remote-queue
Package laravel-remote-queue
Short Description Submit jobs to and receive jobs from other Laravel or Lumen instances.
License MIT
Informations about the package laravel-remote-queue
Remote Queue
Submit jobs to and receive jobs from other Laravel or Lumen instances.
Installation
Laravel
The service provider is auto-discovered by Laravel.
Lumen
Add $app->register(Biigle\RemoteQueue\RemoteQueueServiceProvider::class);
to bootstrap/app.php
.
Usage
This package can be used to submit queued jobs to another Laravel or Lumen application, receive jobs from another application or both.
Receive jobs
By default, this package does not allow receiving of jobs from another application. To allow this, set the remote-queue.listen
configuration to true
. Tokens are used to authenticate incoming requests. A token is just some long random string in this case. Configure remote-queue.accept-tokens
with all tokens that are accepted. All received jobs which are successfully authenticated are pushed to a "regular" queue of this application and processed by the queue worker.
Important: Make sure that the job class exists in both the submitting and receiving application.
Submit jobs
Jobs pushed to the remote queue are transmitted via HTTP and processed on another application. To use the remote queue, configure a queue connection in the queue.connections
config to use the remote
driver. Example:
You can now dispatch jobs to the remote queue connection just like any other connection.
Submit/Response Pattern
We developed this package to be able to process jobs on a remote machine with GPU. To return the computed results, we applied what we call the "submit/response" pattern.
In this pattern, this package is installed on both Laravel/Lumen instances (let's call them A and B). In instance A, the remote queue is configured to push jobs to instance B (the one with the GPU). In instance B, the remote queue is configured to push jobs to instance A. New GPU jobs are submitted from instance A to the remote queue on instance B. Once the results are computed, they are returned as a "response job" to the remote queue on instance A where the results can be further processed.
Configuration
You can override any of these configuration options of the remote-queue
config either directly or via environment variables:
remote-queue.listen
Default: false
Environment: REMOTE_QUEUE_LISTEN
Accept and process jobs sent to this application instance.
remote-queue.endpoint
Default: api/v1/remote-queue
Environment: REMOTE_QUEUE_ENDPOINT
API endpoint to receive new jobs.
remote-queue.connection
Default: null
Environment: REMOTE_QUEUE_CONNECTION
Use this queue connection to process received jobs. If null
, the default connection is used.
remote-queue.accept_tokens
Default: []
Environment: REMOTE_QUEUE_ACCEPT_TOKENS
Accept jobs only if they provide one of these tokens. Specify tokens as comma separated list if you use the environment variable. One way to generate tokens is this command: head -c 32 /dev/urandom | base64
.
remote-queue.accept_ips
Default: []
Accept requests only from the IP addresses of this whitelist. Leave empty to accept jobs from all IPs.
remote-queue.accept_jobs
Default: []
Accept only jobs of this whitelist of class names. Leave empty to accept all job classes.
All versions of laravel-remote-queue with dependencies
illuminate/queue Version ^5.7 >=5.7.7 | ^6.0
illuminate/support Version ^5.7 >=5.7.7 | ^6.0
illuminate/contracts Version ^5.7 >=5.7.7 | ^6.0
illuminate/routing Version ^5.7 >=5.7.7 | ^6.0