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
Inconsistent APIs for IO::Socket::Async and Proc::Async #3707
Comments
From @moritzBoth IO::Socket::Async and Proc::Async have the options to get supplies 1) Proc::Async has methods stdout(:$bin), IO::Socket::Async has 2) Proc::Async has live supplies, and requires you to set them up before In the interest of a smooth asynchronous experience, we should make them |
From @lizmat
I will take that into the newio branch, unless someone beats me to it in nom. Liz |
The RT System itself - Status changed from 'new' to 'open' |
From @moritzHi, On 27.02.2015 23:57, Elizabeth Mattijsen wrote:
Thanks. While I'm at it, there are two more inconsistencies between 1. IO::Socket::Async.connect() uses positional arguments for the host 2. ::Async uses separate .connect and .listen methods, ::INET uses a Cheers, |
From @jnthnHi, 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:
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.
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.
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 |
@jnthn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#123949 (status was 'resolved')
Searchable as RT123949$
The text was updated successfully, but these errors were encountered: