메소드 | 설명 | |
---|---|---|
ack ( array $message ) : void | Acknowledge a message was processed and remove from queue. | |
ackSend ( array $message, array $payload, integer $earliestGet, float $priority, boolean $newTimestamp = true ) : void | Atomically acknowledge and send a message to the queue. | |
count ( array $query, boolean | null $running = null ) : integer | Count queue messages. | |
ensureCountIndex ( array $fields, boolean $includeRunning ) : void | Ensure an index for the count() method. | |
ensureGetIndex ( array $beforeSort = [], array $afterSort = [] ) : void | Ensure an index for the get() method. | |
get ( array $query, integer $runningResetDuration, integer $waitDurationInMillis = 3000, integer $pollDurationInMillis = 200 ) : array | null | Get a non running message from the queue. | |
requeue ( array $message, integer $earliestGet, float $priority, boolean $newTimestamp = true ) : void | Requeue message to the queue. Same as ackSend() with the same message. | |
send ( array $payload, integer $earliestGet, float $priority ) : void | Send a message to the queue. |
public ackSend ( array $message, array $payload, integer $earliestGet, float $priority, boolean $newTimestamp = true ) : void | ||
$message | array | the message to ack received from get() |
$payload | array | the data to store in the message to send. Data is handled same way as \MongoDB\Collection::insertOne() |
$earliestGet | integer | earliest unix timestamp the message can be retreived. |
$priority | float | priority for order out of get(). 0 is higher priority than 1 |
$newTimestamp | boolean | true to give the payload a new timestamp or false to use given message timestamp |
리턴 | void |
public count ( array $query, boolean | null $running = null ) : integer | ||
$query | array | in same format as \MongoDB\Collection::find() where top level fields do not contain operators. Lower level fields can however. eg: valid {a: {$gt: 1}, "b.c": 3}, invalid {$and: [{...}, {...}]} |
$running | boolean | null | query a running message or not or all |
리턴 | integer | the count |
public get ( array $query, integer $runningResetDuration, integer $waitDurationInMillis = 3000, integer $pollDurationInMillis = 200 ) : array | null | ||
$query | array | in same format as \MongoDB\Collection::find() where top level fields do not contain operators. Lower level fields can however. eg: valid {a: {$gt: 1}, "b.c": 3}, invalid {$and: [{...}, {...}]} |
$runningResetDuration | integer | second duration the message can stay unacked before it resets and can be retreived again. |
$waitDurationInMillis | integer | millisecond duration to wait for a message. |
$pollDurationInMillis | integer | millisecond duration to wait between polls. |
리턴 | array | null | the message or null if one is not found |
public requeue ( array $message, integer $earliestGet, float $priority, boolean $newTimestamp = true ) : void | ||
$message | array | message received from get(). |
$earliestGet | integer | earliest unix timestamp the message can be retreived. |
$priority | float | priority for order out of get(). 0 is higher priority than 1 |
$newTimestamp | boolean | true to give the payload a new timestamp or false to use given message timestamp |
리턴 | void |
public send ( array $payload, integer $earliestGet, float $priority ) : void | ||
$payload | array | the data to store in the message. Data is handled same way as \MongoDB\Collection::insertOne() |
$earliestGet | integer | earliest unix timestamp the message can be retreived. |
$priority | float | priority for order out of get(). 0 is higher priority than 1 |
리턴 | void |