Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use deprecate_binding for RemoteRef #15953

Closed
wants to merge 1 commit into from
Closed

Use deprecate_binding for RemoteRef #15953

wants to merge 1 commit into from

Conversation

timholy
Copy link
Member

@timholy timholy commented Apr 20, 2016

Currently in master there's a deprecation for RemoteRef (see #14458), but it's not sufficient for function declarations:

julia> foo(rr::RemoteRef) = 7
ERROR: ArgumentError: invalid type for argument rr in method definition for foo at REPL[1]:1
 in eval(::Module, ::Any) at ./boot.jl:236

This switches it to @deprecate_binding, which does suffice. CC @amitmurthy.

This allows one to use it as a type in function declarations
@amitmurthy
Copy link
Contributor

The change is fine.

But would like to mention that while RemoteChannel is functionally equivalent to RemoteRef, in function declarations you most probably want foo(v::Future) since v would typically be the return value from a remotecall or @spawn. A Future has slightly different behavior from RemoteChannel (write-once and local caching of data once fetched). In 0.5 all remote calls return Futures

timholy added a commit to JuliaLang/Compat.jl that referenced this pull request Apr 20, 2016

Verified

This commit was signed with the committer’s verified signature.
targos Michaël Zasso
See also JuliaLang/julia#15953 for further discussion
@amitmurthy
Copy link
Contributor

Working with the assumption that RemoteRef was mainly used in the context of remotecall* calls or @spawn* calls, it may be better to change the binding of RemoteRef to Future in deprecated.jl.

This will of course fail with code that explicitly created remote refs, RemoteRef() or RemoteRef(pid) - which should use RemoteChannel now, but the assumption here is that this type of usage was far lesser than that of return values from remote calls.

@tkelman
Copy link
Contributor

tkelman commented Aug 3, 2016

Bump?

@GunnarFarneback
Copy link
Contributor

I have code that explicitly creates remote refs and also stores them inside a type. This currently gives a somewhat cryptic error message (simplified example)

julia> type T
           r::RemoteRef{Channel{Any}}
       end
ERROR: TypeError: Type{...} expression: expected Type{T}, got Base.#RemoteRef

With deprecate_binding, as Tim suggests, this gives an understandable deprecation message instead.

@timholy
Copy link
Member Author

timholy commented Aug 13, 2016

I'm not the right one to decide about this stuff. Feel free to take it from here, @amitmurthy.

@timholy timholy closed this Feb 20, 2017
@timholy timholy deleted the teh/remoteref branch February 20, 2017 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants