File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /**
4
+ * Copyright 2015 DataStax, Inc.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ namespace Cassandra ;
20
+
21
+ /**
22
+ * A future that always resolves in a value.
23
+ */
24
+ final class FutureValue implements Future
25
+ {
26
+ /**
27
+ * Actual value to resolve this future with.
28
+ *
29
+ * @var mixed
30
+ */
31
+ private $ value ;
32
+
33
+ /**
34
+ * Creates a future value.
35
+ *
36
+ * @param mixed $value a value to resolve this future with.
37
+ */
38
+ public function __construct ($ value )
39
+ {
40
+ $ this ->value = $ value ;
41
+ }
42
+
43
+ /**
44
+ * {@inheritDoc}
45
+ */
46
+ public function get ($ timeout = null )
47
+ {
48
+ return $ this ->value ;
49
+ }
50
+ }
Original file line number Diff line number Diff line change @@ -198,6 +198,10 @@ public function nextPage($timeout = null)
198
198
*/
199
199
public function nextPageAsync ()
200
200
{
201
+ if (isLastPage ()) {
202
+ return new FutureValue (null );
203
+ }
204
+
201
205
try {
202
206
cassandra_statement_set_paging_state ($ this ->statement , $ this ->resource );
203
207
} catch (Exception $ e ) {
You can’t perform that action at this time.
0 commit comments