Skip to content

Commit

Permalink
Merge pull request #185 from JuliaLang/teh/remoteref
Browse files Browse the repository at this point in the history
Add support for RemoteChannel/RemoteRef
  • Loading branch information
timholy committed Apr 20, 2016
2 parents e71e7f2 + 51dbd88 commit cc3f69b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,13 @@ 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
if VERSION < v"0.4.0"
@compat rc = RemoteChannel(1,2,3)
else
@compat rc = RemoteChannel{Channel{Any}}(1,2,3)
end

0 comments on commit cc3f69b

Please sign in to comment.