Skip to content

Commit 128f069

Browse files
committed
fix cleaner name
1 parent 2f61970 commit 128f069

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# About
1010

11-
The `TarantoolStore` implements symfony `PersistingStoreInterface` and persist locks using Tarantool Database.
11+
The `TarantoolStore` implements symfony `PersistingStoreInterface` using Tarantool Database.
1212

1313
# Installation
1414

@@ -61,21 +61,21 @@ if ($lock->acquire()) {
6161

6262
# Expiration helper
6363

64-
When key is expired it will be removed on acquiring new lock with same name. If your key names are not unique, you can use expiration daemon to cleanup your database.
64+
When key is expired it will be removed on acquiring new lock with same name. If your key names are not unique, you can use php cleaner to cleanup your database. The best way to cleanup data is start a fiber inside tarantool. For more details see [expirationd module documentation](https://github.com/tarantool/expirationd)
6565

6666
```php
6767
use Tarantool\Client\Client;
68-
use Tarantool\SymfonyLock\ExpirationDaemon;
68+
use Tarantool\SymfonyLock\Cleaner;
6969

7070
$client = Client::fromDefaults();
71-
$expiration = new ExpirationDaemon($client);
71+
$cleaner = new Cleaner($client);
7272

7373
// cleanup keys that are expired
74-
$expiration->process();
74+
$cleaner->process();
7575

76-
// by default expiration daemon will clean upto 100 items
76+
// by default cleaner will process upto 100 items
7777
// you can override it via optional configuration
78-
$expiration = new ExpirationDaemon($client, [
78+
$cleaner = new Cleaner($client, [
7979
'limit' => 10,
8080
]);
8181

@@ -86,12 +86,12 @@ $expiration = new ExpirationDaemon($client, [
8686

8787
```php
8888
use Tarantool\Client\Client;
89-
use Tarantool\SymfonyLock\ExpirationDaemon;
89+
use Tarantool\SymfonyLock\Cleaner;
9090
use Tarantool\SymfonyLock\SchemaManager;
9191
use Tarantool\SymfonyLock\TarantoolStore;
9292

9393
$client = Client::fromDefaults();
94-
$expiration = new ExpirationDaemon($client, [
94+
$cleaner = new Cleaner($client, [
9595
'space' => 'lock',
9696
'limit' => '100',
9797
]);

src/ExpirationDaemon.php renamed to src/Cleaner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Tarantool\Client\Client;
66
use InvalidArgumentException;
77

8-
class ExpirationDaemon
8+
class Cleaner
99
{
1010
use OptionalConstructor;
1111

tests/TarantoolStoreTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Symfony\Component\Lock\PersistingStoreInterface;
99
use Tarantool\Client\Client;
1010
use Tarantool\Client\Schema\Criteria;
11-
use Tarantool\SymfonyLock\ExpirationDaemon;
11+
use Tarantool\SymfonyLock\Cleaner;
1212
use Tarantool\SymfonyLock\SchemaManager;
1313
use Tarantool\SymfonyLock\TarantoolStore;
1414

@@ -153,22 +153,22 @@ public function testPutOffExpiration()
153153
$this->assertNotSame($data[0][2], $updated[0][2], "expiration was updated");
154154
}
155155

156-
public function testExpirationDaemon()
156+
public function testCleaner()
157157
{
158158
$space = $this->client->getSpace('lock');
159159
$space->insert([ 'key1', 'token', microtime(true) ]);
160160
$space->insert([ 'key2', 'token', microtime(true) ]);
161161
$space->insert([ 'key3', 'token', microtime(true) ]);
162162

163-
$expiration = new ExpirationDaemon($this->client);
164-
$this->assertSame(3, $expiration->process());
163+
$cleaner = new Cleaner($this->client);
164+
$this->assertSame(3, $cleaner->process());
165165
$this->assertCount(0, $space->select(Criteria::key([])));
166166
}
167167

168-
public function testExpirationDaemonLimit()
168+
public function testCleanerLimit()
169169
{
170170
$space = $this->client->getSpace('lock');
171-
$expiration = new ExpirationDaemon($this->client, [
171+
$cleaner = new Cleaner($this->client, [
172172
'limit' => 1,
173173
]);
174174

@@ -178,14 +178,14 @@ public function testExpirationDaemonLimit()
178178

179179
$this->assertCount(3, $space->select(Criteria::key([])));
180180

181-
$this->assertSame(1, $expiration->process());
181+
$this->assertSame(1, $cleaner->process());
182182
$this->assertCount(2, $space->select(Criteria::key([])));
183183

184-
$this->assertSame(1, $expiration->process());
184+
$this->assertSame(1, $cleaner->process());
185185
$this->assertCount(1, $space->select(Criteria::key([])));
186186

187187
// last record is not expired
188-
$this->assertSame(0, $expiration->process());
188+
$this->assertSame(0, $cleaner->process());
189189
$this->assertCount(1, $space->select(Criteria::key([])));
190190
}
191191
}

0 commit comments

Comments
 (0)