Skip to content

Commit 848ba64

Browse files
author
Eugene Leonovich
committed
Replace option classes with single Options class
1 parent f4a544d commit 848ba64

File tree

4 files changed

+9
-39
lines changed

4 files changed

+9
-39
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,11 @@ queue supports. For example, `fifottl` queue (which we defined earlier in our Lu
110110
supports `delay`, `ttl`, `ttr` and `pri` options:
111111

112112
```php
113-
$queue->put('foo', [TtlOptions::DELAY => 30]);
114-
$queue->put('bar', [TtlOptions::TTL => 5]);
115-
$queue->put('baz', [TtlOptions::TTR => 10, TtlOptions::PRI => 42]);
113+
use Tarantool\Queue\Options;
114+
115+
$queue->put('foo', [Options::DELAY => 30]);
116+
$queue->put('bar', [Options::TTL => 5]);
117+
$queue->put('baz', [Options::TTR => 10, Options::PRI => 42]);
116118
```
117119

118120
> See the full list of available options [here](https://github.com/tarantool/queue#queue-types).
@@ -150,7 +152,7 @@ Or put back into the queue in case it cannot be executed:
150152
$task = $queue->release($task->getId());
151153

152154
// for *ttl queues you can specify a delay
153-
$task = $queue->release($task->getId(), [TtlOptions:DELAY => 30]);
155+
$task = $queue->release($task->getId(), [Options::DELAY => 30]);
154156
```
155157

156158
To look at a task without changing its state, use:

src/TtlOptions.php renamed to src/Options.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111

1212
namespace Tarantool\Queue;
1313

14-
interface TtlOptions
14+
abstract class Options
1515
{
16+
const DELAY = 'delay';
1617
const PRI = 'pri';
1718
const TTL = 'ttl';
1819
const TTR = 'ttr';
19-
const DELAY = 'delay';
20+
const UTUBE = 'utube';
2021
}

src/UtubeOptions.php

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/UtubettlOptions.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)