From 7591531e4772c6ec5197045a8e028eee393d5628 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Wed, 20 Apr 2016 05:59:43 -0500 Subject: [PATCH 1/2] Add support for RemoteChannel/RemoteRef See also https://github.com/JuliaLang/julia/pull/15953 for further discussion --- src/Compat.jl | 3 +++ test/runtests.jl | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/Compat.jl b/src/Compat.jl index 1121285110f5e..289fe87f1bd62 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -528,6 +528,9 @@ function _compat(ex::Symbol) if VERSION < v"0.4.0-dev+768" && ex === :Void return :Nothing end + if VERSION < v"0.5.0-dev+1343" && (ex == :Future || ex == :RemoteChannel) + return :RemoteRef + end return ex end _compat(ex) = ex diff --git a/test/runtests.jl b/test/runtests.jl index c59f85cfeece8..20c0fde84dc70 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -994,3 +994,9 @@ cd(dirwalk) do end rm(dirwalk, recursive=true) + +# RemoteChannel/Future +r = remotecall(sin, 1, pi/3) +@compat foo(r::Future) = 7 +@test foo(r) == 7 +@compat rc = RemoteChannel{Channel{Any}}(1,2,3) From 51dbd8821b578ba7ba6b9d455a12bc8443d8782e Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Wed, 20 Apr 2016 06:39:56 -0500 Subject: [PATCH 2/2] Fix RemoteChannel test on 0.3 --- test/runtests.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 20c0fde84dc70..7664e204984c2 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -999,4 +999,8 @@ rm(dirwalk, recursive=true) r = remotecall(sin, 1, pi/3) @compat foo(r::Future) = 7 @test foo(r) == 7 -@compat rc = RemoteChannel{Channel{Any}}(1,2,3) +if VERSION < v"0.4.0" + @compat rc = RemoteChannel(1,2,3) +else + @compat rc = RemoteChannel{Channel{Any}}(1,2,3) +end