1 | <?php |
||
11 | class Pool |
||
12 | { |
||
13 | private $internal; |
||
14 | |||
15 | public function __construct($size = null) |
||
19 | |||
20 | /** |
||
21 | * Allocates a single resource when one becomes available |
||
22 | * |
||
23 | * @return PartialAllocationPromise |
||
24 | */ |
||
25 | public function allocateOne() |
||
29 | |||
30 | /** |
||
31 | * Allocates the specified number of resources when they become available |
||
32 | * |
||
33 | * @param int $count |
||
34 | * @return PartialAllocationPromise |
||
35 | */ |
||
36 | public function allocate($count) |
||
40 | |||
41 | /** |
||
42 | * Allocates all of the pool's resources when they become available |
||
43 | * |
||
44 | * @return AllocationPromise |
||
45 | */ |
||
46 | public function allocateAll() |
||
50 | |||
51 | /** |
||
52 | * Sets the number of resources in the pool |
||
53 | * |
||
54 | * @param int $size |
||
55 | */ |
||
56 | public function setSize($size) |
||
60 | |||
61 | /** |
||
62 | * Returns the number of resources which are not currently allocated |
||
63 | * |
||
64 | * @return int |
||
65 | */ |
||
66 | public function getAvailability() |
||
70 | |||
71 | /** |
||
72 | * Returns the number of resources which are currently allocated |
||
73 | * |
||
74 | * @return int |
||
75 | */ |
||
76 | public function getUsage() |
||
80 | |||
81 | /** |
||
82 | * @param callable|null $fulfilledHandler |
||
83 | * @return PromiseInterface |
||
84 | */ |
||
85 | public function whenNextIdle($fulfilledHandler = null) |
||
89 | } |
||
90 |