You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to use queue, you first need to make sure that your Tarantool instance
24
+
is configured, up and running. The minimal required configuration might look like this:
25
+
26
+
```lua
27
+
-- queues.lua
28
+
29
+
box.cfg {}
30
+
31
+
queue=require('queue')
32
+
queue.start()
33
+
34
+
localtube_name='foobar'
35
+
ifnull==queue.tube[tube_name] then
36
+
queue.create_tube(tube_name, 'fifottl')
37
+
end
38
+
```
39
+
40
+
> You can read more about the box configuration in the official [Tarantool documentation](http://tarantool.org/doc/book/configuration/index.html#initialization-file).
41
+
> For more information about the queue configuration check out [queue's README](https://github.com/tarantool/queue/blob/master/README.md).
42
+
43
+
To start the instance you need to copy (or symlink) `queues.lua` file into the `/etc/tarantool/instances.enabled`
44
+
directory and run the following command:
45
+
46
+
```sh
47
+
$ sudo tarantoolctl start queues
48
+
```
49
+
50
+
51
+
## Working with queue
52
+
53
+
Once you have your instance running, you can start by creating a queue object with the queue (tube) name you defined
54
+
in the Lua script:
18
55
19
56
```php
20
57
use Tarantool\Queue\Queue;
21
58
22
59
$tarantool = new Tarantool();
23
-
$queue = new Queue($tarantool, 'my_queue');
60
+
$queue = new Queue($tarantool, 'foobar');
61
+
```
62
+
63
+
64
+
### Data types
65
+
66
+
Under the hood Tarantool uses [MessagePack](http://msgpack.org/) binary format to serialize/deserialize
67
+
data being stored in a queue. This means that it's safe to use such data types as `null`, `bool`, `int`,
68
+
`float`, `string`, `binary string` and `array` without any manual pre- or post-processing:
0 commit comments