Closed alexli0707 closed 6 years ago
Update: The package now supports Laravel's native subscribe()
and psubscribe()
API with version 2.4.0.
Sorry for the delay, @alexli0707. We were on holiday here. This issue is a limitation of the current version of the Predis API. We can use the following lower-level workaround to enable psubscribe()
:
$client = RedisSentinel::connection('name')->client();
$client->connect();
$client->getConnection()->getCurrent()->psubscribe(...);
Note that we cannot publish()
messages to a Redis slave. We need to use a connection to the Redis master:
$client->getConnection()->getMaster()->publish(...);
I'm working on a patch for PUB/SUB and transaction()
that makes this more seamless by abstracting these details, but I need to do more testing. The code shown above should work for now.
Thanks, I went to check Predis's API and handle this problem in another way,but I think this way is better~
@alexli0707 - the package now supports Laravel's native subscribe()
and psubscribe()
API with version 2.4.0. This adds high-availability that we don't get with the previous solution above.
Thandks for you project first. After config redis sentinel when using
meet this exception