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

Simplify Channel constructors, change kwargs to positional args. #32818

Merged
merged 6 commits into from
Aug 11, 2019
Merged
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions base/channels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ true
The following constructors were added in Julia 1.3.

Other constructors:
* `Channel{T}(func::Function, sz=0)`
* `Channel{T}(func::Function, size)`
* `Channel{T}(func::Function; csize=0, taskref=nothing)`
NHDaly marked this conversation as resolved.
Show resolved Hide resolved

```jldoctest
Expand All @@ -129,8 +129,8 @@ function Channel(func::Function; ctype=Any, csize=0, taskref=nothing)
isa(taskref, Ref{Task}) && (taskref[] = task)
return chnl
end
function Channel{T}(f::Function, sz=0) where T
return Channel(f, csize=sz, ctype=T)
function Channel{T}(f::Function, size) where T
return Channel(f, csize=size, ctype=T)
end
function Channel{T}(f::Function; csize=0, taskref=nothing) where T
return Channel(f, csize=csize, ctype=T, taskref=taskref)
NHDaly marked this conversation as resolved.
Show resolved Hide resolved
Expand Down