Skip to content

Commit 5b62347

Browse files
update stream methods
1 parent 4bc25cf commit 5b62347

File tree

1 file changed

+73
-60
lines changed

1 file changed

+73
-60
lines changed

src/Redis.php

Lines changed: 73 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -3326,10 +3326,11 @@ public function getMode() {}
33263326

33273327
/**
33283328
* Acknowledge one or more messages on behalf of a consumer group.
3329-
* @param string $stream
3330-
* @param string $group
3331-
* @param array $arr_messages
3332-
* @return int The number of messages Redis reports as acknowledged.
3329+
* @param string $stream
3330+
* @param string $group
3331+
* @param array $arr_messages
3332+
* @return int The number of messages Redis reports as acknowledged.
3333+
* @link https://redis.io/commands/xack
33333334
* @example
33343335
* <pre>
33353336
* $obj_redis->xAck('stream', 'group1', ['1530063064286-0', '1530063064286-1']);
@@ -3339,10 +3340,11 @@ public function xAck($stream, $group, $arr_messages) {}
33393340

33403341
/**
33413342
* Add a message to a stream.
3342-
* @param string $str_key
3343-
* @param string $str_id
3344-
* @param $arr_message
3345-
* @return string The added message ID.
3343+
* @param string $str_key
3344+
* @param string $str_id
3345+
* @param array $arr_message
3346+
* @return string The added message ID.
3347+
* @link https://redis.io/commands/xadd
33463348
* @example
33473349
* <pre>
33483350
* $obj_redis->xAdd('mystream', "*", ['field' => 'value']);
@@ -3352,13 +3354,14 @@ public function xAdd($str_key, $str_id, $arr_message) {}
33523354

33533355
/**
33543356
* Claim ownership of one or more pending messages.
3355-
* @param string $str_key
3356-
* @param string $str_group
3357-
* @param string $str_consumer
3358-
* @param int $min_idle_time
3359-
* @param array $arr_ids
3360-
* @param array $arr_options ['IDLE' => $value, 'TIME' => $value, 'RETRYCOUNT' => $value, 'FORCE', 'JUSTID']
3361-
* @return array Either an array of message IDs along with corresponding data, or just an array of IDs (if the 'JUSTID' option was passed).
3357+
* @param string $str_key
3358+
* @param string $str_group
3359+
* @param string $str_consumer
3360+
* @param int $min_idle_time
3361+
* @param array $arr_ids
3362+
* @param array $arr_options ['IDLE' => $value, 'TIME' => $value, 'RETRYCOUNT' => $value, 'FORCE', 'JUSTID']
3363+
* @return array Either an array of message IDs along with corresponding data, or just an array of IDs (if the 'JUSTID' option was passed).
3364+
* @link https://redis.io/commands/xclaim
33623365
* @example
33633366
* <pre>
33643367
* $ids = ['1530113681011-0', '1530113681011-1', '1530113681011-2'];
@@ -3382,9 +3385,10 @@ public function xClaim($str_key, $str_group, $str_consumer, $min_idle_time, $arr
33823385

33833386
/**
33843387
* Delete one or more messages from a stream.
3385-
* @param string $str_key
3386-
* @param array $arr_ids
3387-
* @return int The number of messages removed.
3388+
* @param string $str_key
3389+
* @param array $arr_ids
3390+
* @return int The number of messages removed.
3391+
* @link https://redis.io/commands/xdel
33883392
* @example
33893393
* <pre>
33903394
* $obj_redis->xDel('mystream', ['1530115304877-0', '1530115305731-0']);
@@ -3393,11 +3397,12 @@ public function xClaim($str_key, $str_group, $str_consumer, $min_idle_time, $arr
33933397
public function xDel($str_key, $arr_ids) {}
33943398

33953399
/**
3396-
* @param string $operation e.g.: 'HELP', 'SETID', 'DELGROUP', 'CREATE', 'DELCONSUMER'
3397-
* @param string $str_key
3398-
* @param string $str_group
3399-
* @param string $str_msg_id
3400-
* @return mixed This command returns different types depending on the specific XGROUP command executed.
3400+
* @param string $operation e.g.: 'HELP', 'SETID', 'DELGROUP', 'CREATE', 'DELCONSUMER'
3401+
* @param string $str_key
3402+
* @param string $str_group
3403+
* @param string $str_msg_id
3404+
* @return mixed This command returns different types depending on the specific XGROUP command executed.
3405+
* @link https://redis.io/commands/xgroup
34013406
* @example
34023407
* <pre>
34033408
* $obj_redis->xGroup('CREATE', 'mystream', 'mygroup');
@@ -3408,10 +3413,11 @@ public function xGroup($operation, $str_key, $str_group, $str_msg_id) {}
34083413

34093414
/**
34103415
* Get information about a stream or consumer groups.
3411-
* @param string $operation e.g.: 'CONSUMERS', 'GROUPS', 'STREAM', 'HELP'
3412-
* @param string $str_stream
3413-
* @param string $str_group
3414-
* @return mixed This command returns different types depending on which subcommand is used.
3416+
* @param string $operation e.g.: 'CONSUMERS', 'GROUPS', 'STREAM', 'HELP'
3417+
* @param string $str_stream
3418+
* @param string $str_group
3419+
* @return mixed This command returns different types depending on which subcommand is used.
3420+
* @link https://redis.io/commands/xinfo
34153421
* @example
34163422
* <pre>
34173423
* $obj_redis->xInfo('STREAM', 'mystream');
@@ -3421,8 +3427,9 @@ public function xInfo($operation, $str_stream, $str_group) {}
34213427

34223428
/**
34233429
* Get the length of a given stream.
3424-
* @param string $str_stream
3425-
* @return int The number of messages in the stream.
3430+
* @param string $str_stream
3431+
* @return int The number of messages in the stream.
3432+
* @link https://redis.io/commands/xlen
34263433
* @example
34273434
* <pre>
34283435
* $obj_redis->xLen('mystream');
@@ -3432,13 +3439,14 @@ public function xLen($str_stream) {}
34323439

34333440
/**
34343441
* Get information about pending messages in a given stream.
3435-
* @param string $str_stream
3436-
* @param string $str_group
3437-
* @param int|string $i_start
3438-
* @param int|string $i_end
3439-
* @param int|string $i_count
3440-
* @param string $str_consumer
3441-
* @return array Information about the pending messages, in various forms depending on the specific invocation of XPENDING.
3442+
* @param string $str_stream
3443+
* @param string $str_group
3444+
* @param int|string $i_start
3445+
* @param int|string $i_end
3446+
* @param int|string $i_count
3447+
* @param string $str_consumer
3448+
* @return array Information about the pending messages, in various forms depending on the specific invocation of XPENDING.
3449+
* @link https://redis.io/commands/xpending
34423450
* @example
34433451
* <pre>
34443452
* $obj_redis->xPending('mystream', 'mygroup');
@@ -3449,11 +3457,12 @@ public function xPending($str_stream, $str_group, $i_start = null, $i_end = null
34493457

34503458
/**
34513459
* Get a range of messages from a given stream.
3452-
* @param string $str_stream
3453-
* @param int $i_start
3454-
* @param int $i_end
3455-
* @param int $i_count
3456-
* @return array The messages in the stream within the requested range.
3460+
* @param string $str_stream
3461+
* @param int $i_start
3462+
* @param int $i_end
3463+
* @param int $i_count
3464+
* @return array The messages in the stream within the requested range.
3465+
* @link https://redis.io/commands/xrange
34573466
* @example
34583467
* <pre>
34593468
* // Get everything in this stream
@@ -3466,10 +3475,11 @@ public function xRange($str_stream, $i_start, $i_end, $i_count = null) {}
34663475

34673476
/**
34683477
* Read data from one or more streams and only return IDs greater than sent in the command.
3469-
* @param $arr_streams
3470-
* @param int|string $i_count
3471-
* @param int|string $i_block
3472-
* @return array The messages in the stream newer than the IDs passed to Redis (if any).
3478+
* @param array $arr_streams
3479+
* @param int|string $i_count
3480+
* @param int|string $i_block
3481+
* @return array The messages in the stream newer than the IDs passed to Redis (if any).
3482+
* @link https://redis.io/commands/xread
34733483
* @example
34743484
* <pre>
34753485
* $obj_redis->xRead(['stream1' => '1535222584555-0', 'stream2' => '1535222584555-0']);
@@ -3479,12 +3489,13 @@ public function xRead($arr_streams, $i_count = null, $i_block = null) {}
34793489

34803490
/**
34813491
* This method is similar to xRead except that it supports reading messages for a specific consumer group.
3482-
* @param string $str_group
3483-
* @param string $str_consumer
3484-
* @param array $arr_streams
3485-
* @param int|string $i_count
3486-
* @param int|string $i_block
3487-
* @return array The messages delivered to this consumer group (if any).
3492+
* @param string $str_group
3493+
* @param string $str_consumer
3494+
* @param array $arr_streams
3495+
* @param int|string $i_count
3496+
* @param int|string $i_block
3497+
* @return array The messages delivered to this consumer group (if any).
3498+
* @link https://redis.io/commands/xreadgroup
34883499
* @example
34893500
* <pre>
34903501
* // Consume messages for 'mygroup', 'consumer1'
@@ -3497,11 +3508,12 @@ public function xReadGroup($str_group, $str_consumer, $arr_streams, $i_count, $i
34973508

34983509
/**
34993510
* This is identical to xRange except the results come back in reverse order. Also note that Redis reverses the order of "start" and "end".
3500-
* @param string $str_stream
3501-
* @param int|string $i_end
3502-
* @param int|string $i_start
3503-
* @param int|string $i_count
3504-
* @return array The messages in the range specified.
3511+
* @param string $str_stream
3512+
* @param int|string $i_end
3513+
* @param int|string $i_start
3514+
* @param int|string $i_count
3515+
* @return array The messages in the range specified.
3516+
* @link https://redis.io/commands/xrevrange
35053517
* @example
35063518
* <pre>
35073519
* $obj_redis->xRevRange('mystream', '+', '-');
@@ -3511,10 +3523,11 @@ public function xRevRange($str_stream, $i_end, $i_start, $i_count = null) {}
35113523

35123524
/**
35133525
* Trim the stream length to a given maximum. If the "approximate" flag is pasesed, Redis will use your size as a hint but only trim trees in whole nodes (this is more efficient)..
3514-
* @param string $str_stream
3515-
* @param int $i_max_len
3516-
* @param bool $boo_approximate
3517-
* @return int The number of messages trimed from the stream.
3526+
* @param string $str_stream
3527+
* @param int $i_max_len
3528+
* @param bool $boo_approximate
3529+
* @return int The number of messages trimed from the stream.
3530+
* @link https://redis.io/commands/xtrim
35183531
* @example
35193532
* <pre>
35203533
* // Trim to exactly 100 messages

0 commit comments

Comments
 (0)