Ability to push job into Redis Queue from inside a Redis Multi block
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.1k
- Forks
- 285
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 2
Description
If I have code that look like this:
<?php
$redis = \Yii::$app->redis;
$redis->multi();
\Yii::$app->queue->push(new SomeJob());
\Yii::$app->queue->push(new SomeJob());
$redis->exec();
The job will be pushed with QUEUED as the id, and only the last job that will be run. That's because this line read from to use an incremented number as the job id.
I propose to use something that doesn't read from redis as the value for id, such as uniqid.
Also, can I know the reason why we used hset to store the job message and only push the job id to the list, instead of directly pushing the id along with the job message to list and not using hset?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/drivers/redis/Queue.php around line 194 and reproduce the two pushes inside a Redis multi/exec block. Trace how job IDs and messages are stored, then add regression coverage showing both jobs remain distinct and runnable after exec; address the question about why hset is used.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, redis
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100