-
Notifications
You must be signed in to change notification settings - Fork 658
Conversation
…ebsockets into feature/async-queue
…ebsockets into feature/async-queue
Codecov Report
@@ Coverage Diff @@
## 2.x #552 +/- ##
==========================================
- Coverage 89.58% 89.24% -0.34%
==========================================
Files 52 54 +2
Lines 1478 1497 +19
==========================================
+ Hits 1324 1336 +12
- Misses 154 161 +7
Continue to review full report at Codecov.
|
Seems alright to me. I think changes were made to the RedisQueue implementation since I last looked at it (Laravel 5.6 ish) such that it now just fires off the redis command and doesn't care about the result. I thought more work would need to be done to handle promises and such. Seems alright though, as long as basically just |
Yes, I have checked the inherited queue class and it seems like all it does is to push it to the queue, without caring too much about the result. So as long as the tests check if the Either way, when the channel manager is bind to the container it would use the React's Redis client (like in the Server command process), otherwise will just fallback to the default parent connection (like PhpRedis or Predis) |
@rennokki Could you clarify in the docs is it everything which should use If so, laravel horizon is no longer compatitable:
|
Closes #190
Description
This PR adds a new
async-redis
connection that should be used in case you use Redis Queue features within the WebSockets server. It can also be set to default, because when no PHPReact Redis instance is available, it uses the default Redis connection.Tests
Tests were taken from the following files, to ensure compatibility with the default Laravel's Redis queue/jobs tests:
Docs
Async Redis Queue
The default Redis connection also interacts with the queues. Since you might want to dispatch jobs on Redis from the server, you can encounter an anti-pattern of using a blocking I/O connection (like PhpRedis or PRedis) within the WebSockets server.
To solve this issue, you can configure the built-in queue driver that uses the Async Redis connection when it's possible, like within the WebSockets server. It's highly recommended to switch your queue to it if you are going to use the queues within the server controllers, for example.
Add the
async-redis
queue driver to your list of connections. The configuration parameters are compatible with the defaultredis
driver:Also, make sure that the default queue driver is set to
async-redis
: