Skip to content

Commit dc0e515

Browse files
author
Jem Bishop
committed
implement completable future on PV class
1 parent ca97a23 commit dc0e515

File tree

1 file changed

+6
-7
lines changed
  • core/pv/src/main/java/org/phoebus/pv

1 file changed

+6
-7
lines changed

core/pv/src/main/java/org/phoebus/pv/PV.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import java.util.List;
1111
import java.util.concurrent.CompletableFuture;
1212
import java.util.concurrent.CopyOnWriteArrayList;
13-
import java.util.concurrent.Future;
1413
import java.util.concurrent.TimeUnit;
1514
import java.util.concurrent.locks.Lock;
1615
import java.util.concurrent.locks.ReentrantLock;
@@ -236,17 +235,17 @@ public VType read()
236235

237236
/** Issue a read request
238237
*
239-
* <p>{@link Future} allows waiting for
238+
* <p>{@link CompletableFuture} allows waiting for
240239
* and obtaining the result, or its <code>get()</code>
241240
* calls will provide an error.
242241
*
243242
* <p>As a side effect, registered listeners will
244243
* also receive the value obtained by this call.
245244
*
246-
* @return {@link Future} for obtaining the result or Exception
245+
* @return {@link CompletableFuture} for obtaining the result or Exception
247246
* @exception Exception on error
248247
*/
249-
public Future<VType> asyncRead() throws Exception
248+
public CompletableFuture<VType> asyncRead() throws Exception
250249
{
251250
// Default: Return last known value
252251
return CompletableFuture.completedFuture(last_value);
@@ -270,17 +269,17 @@ public void write(final Object new_value) throws Exception
270269

271270
/** Write value with confirmation
272271
*
273-
* <p>{@link Future} can be used to await completion
272+
* <p>{@link CompletableFuture} can be used to await completion
274273
* of the write.
275274
* The <code>get()</code> will not return a useful value (null),
276275
* but they will throw an error if the write failed.
277276
*
278277
* @param new_value Value to write to the PV
279-
* @return {@link Future} for awaiting completion or exception
278+
* @return {@link CompletableFuture} for awaiting completion or exception
280279
* @exception Exception on error
281280
* @see #write(Object)
282281
*/
283-
public Future<?> asyncWrite(final Object new_value) throws Exception
282+
public CompletableFuture<?> asyncWrite(final Object new_value) throws Exception
284283
{ // Default: Normal write, declare 'done' right away
285284
write(new_value);
286285
return CompletableFuture.completedFuture(null);

0 commit comments

Comments
 (0)