Download the PHP package littlebookboy/laravel-request-queue without Composer

On this page you can find all versions of the php package littlebookboy/laravel-request-queue. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-request-queue

Queue

說明

提供一個簡單實現將 request 派送到隊列,並使用 Redis (或 MySQL) 資料庫儲存隊列工作。隊列工作的監聽則透過 supervisord,來輔助背景監聽。

安裝

使用 composer 安裝套件

註冊服務提供者

發佈

MySQL

Redis

兩種資料庫擇一使用,本專案預設使用 Redis

本機環境

安裝 Redis Server,在此以 Mac 為例,可以參考官網的 installing-redis-on-mac-os-x 安裝

啟用 Redis Server

背景執行可用

確認啟動了 Redis Server,使用此指令來列出目前關於 redis-server 常駐的命令

啟動 CLI,會看到預設的 redis connection 是 127.0.0.1:6379

專案環境

因為我是用 MAMP 環境,所以必須讓他的 PHP 支援 Redis,可以參考這個說明去安裝 panxianhai/php-redis-mamp, 裡面也有直接放好該有的 redis.so,不用自己去 php.net 手動編譯出來。 修改 php.ini,若是 MAMP Pro,打開 php.ini 可以在 找到。

重啟 MAMP 後打開 phpinfo 看,有出現 redis 表示 MAMP 中的 PHP 庫已支援 Redis, 而 Laravel 已經有一套很完整的機制可以讓你快速連結到你本機的 Redis,在這個專案中, 我使用的是 predis/predis 這個套件。

Example

假設現在你有專案預設的 User model 與 users 資料表,裡面有一個 id 為 1 的使用者資料;

若記錄緝捕追到相同的請求識別 id 時,會回應 409 告訴請求方,表示識別 id 發生衝突。

若是透過 AJAX 發送請求,要加入 Header 告訴系統我是用 AJAX 傳遞資料,不然測試時, 會遇到 request 參數收不到的情形,請參考

接收請求路由

隊列工作啟動條件目前設置為 patch, put, delete 三種請求會進行請求回應的處理流程

請求 callback 參數

請求時傳入包含 與 兩個參數,系統會回應 202, 表示請求已接受,並把實際請求派送到隊列中,進行處理,並在處理後呼叫 這個位址。

若是沒有傳送 與 時,系統會直接處理該請求,並回應請求方,這種作法請求方需等候回應。

callback 路由,將原始請求的請求識別 id 回應到 callback 位址

測試用控制器,處理 202 之後的隊列工作

設定隊列監聽

本例設定

Config

可設定 與

name description
driver 隊列使用的資料庫
base_url 處理實際請求時,使用的專案域名

Fail Jobs

失敗的訊息可用官方的資料表

請注意,隊列監聽中,當有程式變動需要重啟監聽才會生效。

處理請求可在 中的 進行邏輯處理。


All versions of laravel-request-queue with dependencies

PHP Build Version
Package Version
Requires predis/predis Version ~1.1
guzzlehttp/guzzle Version ~6.2.3
littlebookboy/laravel-request-recorder Version ~1.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package littlebookboy/laravel-request-queue contains the following files

Loading the files please wait ....