Hi, I wrote these issues up in a gist:
https://gist.github.com/jnthn/9d8b2e22882d7f7a871e They got some discussion on channel, and the decisions implemented. On Wed Mar 04 01:08:29 2015, moritz wrote: > On 27.02.2015 23:57, Elizabeth Mattijsen wrote: > >> On 27 Feb 2015, at 17:24, Moritz Lenz (via RT) <perl6-bugs- > >> follo...@perl.org> wrote: > >> Both IO::Socket::Async and Proc::Async have the options to get > >> supplies > >> for binary or string data, but there are two inconsitentcies: > >> > >> 1) Proc::Async has methods stdout(:$bin), IO::Socket::Async has > >> chars_supply and bytes_supply. There should be some naming > >> consistency here > >> Now IO::Socket::Async is consistent with IO::Handle: you have a .Supply method and can give it an optional :bin parameter. This is consistent with the :$bin parameter that stdout and stdin have on Proc::Async. Since there are two supplies you could want, then we can't just have .Supply on a Proc::Async. Updated S32-io/IO-Socket-Async.t to use the .Supply method. > >> 2) Proc::Async has live supplies, and requires you to set them up > >> before > >> starting the process. IO::Socket::Async has on-demand supplies that > >> you > >> can get after the fact. > >> When you are listening on a socket for incoming connections, you already have the socket, so there's no chance to take the supply earlier. With processes, obtaining the supplies has a secondary role of indicating what handles to bind when the process is spawned, which has to happen before we spawn it. So, the current design seems right. > While I'm at it, there are two more inconsistencies between > IO::Socket::Async and IO::Socket::INET: > > 1. IO::Socket::Async.connect() uses positional arguments for the host > and port, while IO::Socket.:INET.new uses > > 2. ::Async uses separate .connect and .listen methods, ::INET uses a > .new with a separate :listen argument to distinguish them. (I think I > tend to prefer the separate methods approach). > IO::Socket::INET gets to keep its new method, but it now also has connect and listen convenience methods, taking positional arguments, for consistency with IO::Socket::Async. Added tests in S32-io/IO-Socket-INET.t for new listen and connect methods. /jnthn