Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Adaptable queue layers

NotificationsYou must be signed in to change notification settings

wdalmut/queue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adaptable queue layers

Build StatusScrutinizer Code QualityCode Coverage

Create

$queue =newQueue("queue name",$queueAdapter);

Check also the wiki

Available Adapters

Receive from queue

list($receipt,$message) =$queue->receive();// receive with optionslist($receipt,$message) =$queue->receive(["timeout" =>15*60]);

Send in queue

$queue->send("my message");// send with options$queue->send("my message", ["delay" =>20]);

Delete from queue

$queue->delete($receipt);// delete with options$queue->delete($receipt, ["delay" =>20]);

Manage different adapters options

Just use functions

$queue =newQueue("https://sqs.amazon.com/39857/urs",$sqsAdapter);$queue->send("message",toSQS(["delay" =>20]));functiontoSQS(array options = []) {$opts = [];if (array_key_exists("delay",$options)) {$opts["DelaySeconds"] =$options["delay"];    }return$opts;}

Queue Interface (for adapters)

You have to implement 3 methods fromCorley\Queue\QueueInterface

publicfunction send($queueName,$message,array$options);publicfunction receive($queueName,array$options);publicfunction delete($queueName,$receipt,array$options);

Tips on return values (receive message)

As you can see the return value

  • The send operation should return the queue send operation status
  • The receiveMUST return an array where the first parameter is the messagereceipt that is need for the remove operation
  • The delete operation should return the queue delete operation status

[8]ページ先頭

©2009-2025 Movatter.jp