PocketMine-MP 5.21.2 git-b2aa6396c3cc2cafdd815eacc360e1ad89599899
Loading...
Searching...
No Matches
SleeperHandlerEntry.php
1<?php
2
3/*
4 * This file is part of Snooze <https://github.com/pmmp/Snooze>
5 * Copyright (c) 2018-2023 PMMP Team
6 *
7 * Snooze is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 */
12
13declare(strict_types=1);
14
15namespace pocketmine\snooze;
16
17use pmmp\thread\ThreadSafe;
18use pmmp\thread\ThreadSafeArray;
19
33final class SleeperHandlerEntry extends ThreadSafe{
34
41 public function __construct(
42 private readonly ThreadSafeArray $sharedObject,
43 private readonly int $id
44 ){}
45
46 final public function getNotifierId() : int{
47 return $this->id;
48 }
49
54 public function createNotifier() : SleeperNotifier{
55 return new SleeperNotifier($this->sharedObject, $this->id);
56 }
57}
createNotifier()