strukt / queue
Memcached Queue
dev-master
2024-01-25 02:20 UTC
Requires
- php: ^8.1
- ext-memcached: *
- strukt/commons: v1.1.1-alpha
This package is not auto-updated.
Last update: 2025-01-10 21:44:02 UTC
README
Simple implementation of a Message Queue that uses Memcached https://memcached.org/ as backend
Needs PHP Memcached extensions installed to work properly
@author Maurizio Giunti https://www.mauriziogiunti.it / https://codeguru.it
@license MIT
Usage
Wait
//wait.php $data = ["username"=>"pitsolu", "password"=>"p@55w0rd"]; wait("queue_test", $data, function($reply){ print_r($reply); });
Reply
//reply.php reply("queue_test", function($data){ $data["processed"] = true; return $data; });
Other Usages
Pop
$data = array( "username"=>"pitsolu", "password"=>"p@55w0rd" ); $uid = push("queue_test", $data);
Push
list($oid, $udata) = pop("queue_test"); print_r(array( "uid"=>$uid, "oid"=>$oid, "data"=>$data, "udata"=>$udata ));