Closed
Description
Description
We should support Semaphore Locks with a MongoDB back end to allow those that already use MongoDB as a distributed storage engine.
Symfony already partially supports MongoDB for session storage: Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandler
Example
$client = new MongoDb\Client();
$store = new Symfony\Component\Lock\Store\MongoDbStore(
$client
array(
database: '%mongo_database%'
collection: lock
)
);
$lockFactory = new Symfony\Component\Lock\Factory($store);
$lock = $lockFactory->createLock('my-resource');