1<?php
2/**
3 * This file is part of the FreeDSx Socket package.
4 *
5 * (c) Chad Sikorra <Chad.Sikorra@gmail.com>
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
10
11namespace FreeDSx\Socket\Queue;
12
13/**
14 * Represents a consumable buffer of data in the queue.
15 *
16 * @author Chad Sikorra <Chad.Sikorra@gmail.com>
17 */
18class Buffer
19{
20    /**
21     * @var string
22     */
23    protected $bytes;
24
25    /**
26     * @var int
27     */
28    protected $endsAt;
29
30    /**
31     * @param string $bytes
32     * @param int $endsAt
33     */
34    public function __construct($bytes, int $endsAt)
35    {
36        $this->bytes = $bytes;
37        $this->endsAt = $endsAt;
38    }
39
40    /**
41     * @return string
42     */
43    public function bytes()
44    {
45        return $this->bytes;
46    }
47
48    /**
49     * @return int
50     */
51    public function endsAt(): int
52    {
53        return $this->endsAt;
54    }
55}
56