We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
redis
1 parent 7d3e2f3 commit 21fb69dCopy full SHA for 21fb69d
src/Mutex.php
@@ -5,8 +5,10 @@
5
use Illuminate\Console\Command;
6
use NinjaMutex\Lock\FlockLock;
7
use NinjaMutex\Lock\MySqlLock;
8
+use NinjaMutex\Lock\PredisRedisLock;
9
use NinjaMutex\Mutex as Ninja;
10
use NinjaMutex\MutexException;
11
+use Redis;
12
13
class Mutex
14
{
@@ -32,7 +34,7 @@ private function strategy()
32
34
return new MySqlLock(env('DB_USERNAME'), env('DB_PASSWORD'), env('DB_HOST'));
33
35
36
case 'redis':
- throw new MutexException('Strategy `redis` is not implemented yet.');
37
+ return new PredisRedisLock(Redis::connection());
38
39
case 'memcache':
40
throw new MutexException('Strategy `memcache` is not implemented yet.');
0 commit comments