@@ -506,6 +506,13 @@ Wait for a value to become available on the specified [`RemoteChannel`](@ref).
506
506
"""
507
507
wait (r:: RemoteChannel , args... ) = (call_on_owner (wait_ref, r, myid (), args... ); r)
508
508
509
+ """
510
+ fetch(x::Future)
511
+
512
+ Wait for and get the value of a [`Future`](@ref). The fetched value is cached locally.
513
+ Further calls to `fetch` on the same reference return the cached value. If the remote value
514
+ is an exception, throws a [`RemoteException`](@ref) which captures the remote exception and backtrace.
515
+ """
509
516
function fetch (r:: Future )
510
517
r. v != = nothing && return something (r. v)
511
518
v = call_on_owner (fetch_ref, r)
@@ -515,22 +522,14 @@ function fetch(r::Future)
515
522
end
516
523
517
524
fetch_ref (rid, args... ) = fetch (lookup_ref (rid). c, args... )
518
- fetch (r:: RemoteChannel , args... ) = call_on_owner (fetch_ref, r, args... )
519
525
520
526
"""
521
- fetch(x )
527
+ fetch(c::RemoteChannel )
522
528
523
- Waits and fetches a value from `x` depending on the type of `x`:
524
-
525
- * [`Future`](@ref): Wait for and get the value of a `Future`. The fetched value is cached locally.
526
- Further calls to `fetch` on the same reference return the cached value. If the remote value
527
- is an exception, throws a [`RemoteException`](@ref) which captures the remote exception and backtrace.
528
- * [`RemoteChannel`](@ref): Wait for and get the value of a remote reference. Exceptions raised are
529
- same as for a `Future` .
530
-
531
- Does not remove the item fetched.
529
+ Wait for and get a value from a [`RemoteChannel`](@ref). Exceptions raised are the
530
+ same as for a `Future`. Does not remove the item fetched.
532
531
"""
533
- fetch (@nospecialize x ) = x
532
+ fetch (r :: RemoteChannel , args ... ) = call_on_owner (fetch_ref, r, args ... )
534
533
535
534
isready (rv:: RemoteValue , args... ) = isready (rv. c, args... )
536
535
0 commit comments