{"id":19297568,"url":"https://github.com/limen/fastrq-php","last_synced_at":"2025-04-22T09:31:24.738Z","repository":{"id":62517159,"uuid":"159013671","full_name":"limen/fastrq-php","owner":"limen","description":"Queue, Stack and Priority Queue built on Redis","archived":false,"fork":false,"pushed_at":"2019-01-16T10:43:42.000Z","size":30,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-21T04:56:36.426Z","etag":null,"topics":["lua","php","queue","redis","stack"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/limen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-25T08:51:58.000Z","updated_at":"2019-12-30T06:41:00.000Z","dependencies_parsed_at":"2022-11-02T13:45:41.955Z","dependency_job_id":null,"html_url":"https://github.com/limen/fastrq-php","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limen%2Ffastrq-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limen%2Ffastrq-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limen%2Ffastrq-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limen%2Ffastrq-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/limen","download_url":"https://codeload.github.com/limen/fastrq-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223893161,"owners_count":17220834,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lua","php","queue","redis","stack"],"created_at":"2024-11-09T23:05:20.363Z","updated_at":"2024-11-09T23:05:21.144Z","avatar_url":"https://github.com/limen.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fastrq - Queue, Stack and Priority Queue based on Redis\r\n\r\n[![Build Status](https://travis-ci.org/limen/fastrq-php.svg?branch=master)](https://travis-ci.org/limen/fastrq-php)\r\n\r\n[Wiki](https://github.com/limen/fastrq/wiki)\r\n\r\n[Fastrq for Python](https://github.com/limen/fastrq)\r\n\r\n## Features\r\n\r\n+ Abstract Queue, Deque, Capped Queue/Deque, and Overflow-able Capped Queue/Deque\r\n+ Abstract Stack, Capped Stack\r\n+ Abstract Priority Queue, Capped Priority Queue and Overflow-able Capped Priority Queue\r\n+ Push and Pop support batch operation\r\n+ Using Lua scripts to save RTT (Round Trip Time)\r\n\r\nmore in [Wiki](https://github.com/limen/fastrq/wiki)\r\n\r\n## install\r\n\r\nRecommend to install via composer\r\n\r\n```\r\ncomposer require limen/fastrq\r\n```\r\n\r\n## Usage\r\n\r\n```php\r\nuse Limen\\Fastrq\\Queue;\r\nuse Limen\\Fastrq\\Deque;\r\nuse Limen\\Fastrq\\Stack;\r\nuse Limen\\Fastrq\\PriorityQueue;\r\n\r\n// queue\r\n$q = new Queue('fastrq-queue');\r\n$q-\u003epush(['hello', 'world']);\r\n$q-\u003epush('!!');\r\n$q-\u003epop();\r\n$q-\u003epop(2);\r\n$q-\u003epushNI('hello');\r\n$q-\u003epushAE('from');\r\n$q-\u003epushNE(['from', 'fastrq']);\r\n\r\n// deque\r\n$dq = new Deque('fastrq-deque');\r\n$dq-\u003epushFront(['hello', 'world']);\r\n$dq-\u003epushBack('!!');\r\n$dq-\u003epopFront();\r\n$dq-\u003epopBack(2);\r\n$dq-\u003epushFrontNI('hello');\r\n$dq-\u003epushBackNI('hello');\r\n$dq-\u003epushFrontNE('from');\r\n$dq-\u003epushBackNE(['from', 'fastrq']);\r\n$dq-\u003epushFrontAE('from');\r\n$dq-\u003epushBackAE(['from', 'fastrq']);\r\n\r\n// stack\r\n$s = new Stack('fastrq-stack');\r\n$s-\u003epush(['hello', 'world']);\r\n$s-\u003epush('!!');\r\n$s-\u003epop();\r\n$s-\u003epop(2);\r\n$s-\u003epushNI('hello');\r\n$s-\u003epushAE('from');\r\n$s-\u003epushNE(['from', 'fastrq']);\r\n\r\n// priority queue\r\n$pq = new PriorityQueue('fastrq-priority-queue');\r\n$pq-\u003epush(['hello' =\u003e 1]);\r\n$pq-\u003epush(['hello' =\u003e 1, 'world' =\u003e 2]);\r\n$pq-\u003epushNI('fastrq', 2);\r\n$pq-\u003epushAE(['hello' =\u003e 1, 'world' =\u003e 2]);\r\n$pq-\u003epushNE(['hello' =\u003e 1, 'world' =\u003e 2]);\r\n\r\n```\r\n\r\n## Data types\r\n\r\n### Queue\r\n\r\n+ first in and first out\r\n+ unlimited capacity\r\n+ support batch push and batch pop\r\n\r\n### Deque\r\n\r\nDerive from queue with more features\r\n\r\n+ support push front and push back\r\n+ support pop front and pop back\r\n\r\n### Capped Queue/Deque\r\n\r\nDerive from queue/deque with more features\r\n\r\n+ Have fixed capacity\r\n+ Push to a full one would fail\r\n+ Push to one whose positions are not enough would fail\r\n\r\n### Overflow-able Capped Queue/Deque\r\n\r\nDerive from capped queue/deque with more features\r\n\r\n+ The queue length would never exceed its capacity\r\n+ Push to an end would push out from the other end if one is full\r\n\r\n### Stack \r\n\r\n+ Last in and First out\r\n+ Unlimited capacity\r\n+ Support batch push and batch pop\r\n\r\n### Capped Stack\r\n\r\nDerive from Stack with more features\r\n\r\n+ Have fixed capacity\r\n+ Push to a full capped stack would fail\r\n+ Push to a capped stack whose positions are not enough would fail\r\n\r\n### Priority Queue\r\n\r\n+ The lower the score, the higher the priority\r\n+ Unlimited capacity\r\n+ Support batch push and batch pop\r\n\r\n### Capped Priority Queue\r\n\r\nDerive from Priority Queue with more features\r\n\r\n+ Have fixed capacity\r\n+ Push to a full one would fail\r\n+ Push to a capped one whose positions are not enough would fail\r\n\r\n### Overflow-able Capped Priority Queue\r\n\r\nDerive from Capped Priority Queue with more features\r\n\r\n+ The queue length would never exceed its capacity\r\n+ Push to an end would push out from the other end if queue is full\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimen%2Ffastrq-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flimen%2Ffastrq-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimen%2Ffastrq-php/lists"}