Why does RemoteChannel have few constructors.

The constructor that creates a RemoteChannel with a specific size and type requires a function as the first argument like RemoteChannel(()->Channel{Int}(10), pid).

Using lambda functions as parameters is inconvenient because we have to write a longer code than we only use values.
Just adding a new constructor could solve this problem. However, no one created this.
So I guess there must be a reason why people have not implemented it.
Can anybody tell me the reason or your thought?

Weird as it may be,
remote channels do not have to be backed by Channels,
they could be backed be any subtype of AbstractChannel.
Not all of which have constructors that take the same arguments.

Further to that,
you don’t always even want to create a new channel at the the same time you create a remote channel,
E,g, in the wild

https://github.com/oxinabox/AuthorGenderStudy.jl/blob/dfb20accfdf018cd2e82888a843b30da2634f290/src/load_data.jl#L7

1 Like