Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/remotecall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ function serialize(s::AbstractSerializer, ::Future)
invoke(serialize, Tuple{AbstractSerializer, Any}, s, zero_fut)
end

function serialize(s::AbstractSerializer, ::RemoteChannel)
zero_rc = RemoteChannel{Channel{Any}}((0,0,0))
function serialize(s::AbstractSerializer, ::RemoteChannel{T}) where T
zero_rc = RemoteChannel{T}((0,0,0))
invoke(serialize, Tuple{AbstractSerializer, Any}, s, zero_rc)
end

Expand Down
8 changes: 6 additions & 2 deletions test/distributed_exec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,12 @@ end
@testset "Ser/deser to non-ClusterSerializer objects" begin
function test_regular_io_ser(ref::DistributedNext.AbstractRemoteRef)
io = IOBuffer()
serialize(io, ref)
# Wrapping the ref in a Dict to exercise the case when the
# type parameter of the RemoteChannel is part of an outer type.
# See https://github.com/JuliaLang/Distributed.jl/issues/178
serialize(io, Dict("ref" => ref))
seekstart(io)
ref2 = deserialize(io)
ref2 = deserialize(io)["ref"]
for fld in fieldnames(typeof(ref))
v = getfield(ref2, fld)
if isa(v, Number)
Expand All @@ -361,6 +364,7 @@ end

test_regular_io_ser(Future())
test_regular_io_ser(RemoteChannel())
test_regular_io_ser(RemoteChannel(() -> Channel{Bool}(1)))
end

@testset "@distributed and [un]buffered reads" begin
Expand Down
Loading