Skip to content

Commit 16379da

Browse files
committed
refactor: remove Options class
1 parent b833e75 commit 16379da

2 files changed

Lines changed: 7 additions & 35 deletions

File tree

‎README.md‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,10 @@ $queue->put('baz', ttr: 10.0, pri: 42);
153153
For custom drivers or the generic API, `put()` accepts the task data and an optional options array:
154154

155155
```php
156-
use Tarantool\Queue\Options;
157-
158-
$genericQueue = new Queue($client, 'foobar');
159-
$genericQueue->put('foo', [Options::DELAY => 30.0]);
160-
$genericQueue->put('bar', [Options::TTL => 5.0]);
161-
$genericQueue->put('baz', [Options::TTR => 10.0, Options::PRI => 42]);
156+
$queue = new Queue($client, 'foobar');
157+
$queue->put('foo', ['delay' => 30.0]);
158+
$queue->put('bar', ['ttl' => 5.0]);
159+
$queue->put('baz', ['ttr' => 10.0, 'pri' => 42]);
162160
```
163161

164162
> *See the [full list of available options](https://github.com/tarantool/queue#queue-types).*
@@ -196,7 +194,7 @@ If the task cannot be executed, return it to the queue:
196194
$task = $queue->release($task->getId());
197195

198196
// For *ttl queues, you can specify a delay.
199-
$task = $queue->release($task->getId(), [Options::DELAY => 30.0]);
197+
$task = $queue->release($task->getId(), ['delay' => 30.0]);
200198
```
201199

202200
To view a task without changing its state, use:
@@ -266,6 +264,7 @@ The result of this call might look like this:
266264
'take' => 1,
267265
...
268266
],
267+
'extra' => [],
269268
]
270269
```
271270

@@ -305,7 +304,7 @@ To invoke this method from PHP, use `Queue::call()`:
305304

306305
```php
307306
$result = $queue->call('put_many', [
308-
'foo' => ['foo', [Options::DELAY => 30.0]],
307+
'foo' => ['foo', ['delay' => 30.0]],
309308
'bar' => ['bar'],
310309
]);
311310
```

‎src/Options.php‎

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

0 commit comments

Comments
 (0)