Skip to content

Commit

Permalink
Add deprecation cycle for Proc::Async
Browse files Browse the repository at this point in the history
So that jnthn's examples from the YAPC::EU presentation still work
  • Loading branch information
lizmat committed Sep 16, 2014
1 parent fa7a1cc commit 124893c
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/core/Proc/Async.pm
Expand Up @@ -33,7 +33,12 @@ my class Proc::Async {
has $!process_handle;
has $!exited_promise;

method new($path, *@args, :$w) { self.bless(:$path,:@args,:$w) }
proto method new(|) { * }
multi method new($path, *@args, :$w) { self.bless(:$path,:@args,:$w) }
multi method new(:$path!, :@args, :$w) {
DEPRECATED( 'new($path,@args)', :what('new(:path(),:args()) (from Proc::Async)') );
self.bless(:$path,:@args,:$w);
}

method !supply(\what,\supply,\type,\value) is hidden_from_backtrace {
X::Proc::Async::TapBeforeSpawn.new(handle => what).throw
Expand Down Expand Up @@ -61,6 +66,26 @@ my class Proc::Async {
self!supply('stderr',$!stderr_supply,$!stderr_type,$bin ?? Bytes !! Chars);
}

method stdout_chars(Proc::Async:D:) {
DEPRECATED('stdout');
self.stdout;
}

method stdout_bytes(Proc::Async:D:) {
DEPRECATED('stdout(:bin)');
self.stdout(:bin);
}

method stderr_chars(Proc::Async:D:) {
DEPRECATED('stderr');
self.stderr;
}

method stderr_bytes(Proc::Async:D:) {
DEPRECATED('stderr(:bin)');
self.stderr(:bin);
}

method start(Proc::Async:D: :$scheduler = $*SCHEDULER, :$ENV) {
X::Proc::Async::AlreadyStarted.new.throw
if $!started;
Expand Down Expand Up @@ -167,6 +192,10 @@ my class Proc::Async {
$p
}

method close_stdin(Proc::Async:D:) {
DEPRECATED('close-stdin');
self.close-stdin;
}
method close-stdin(Proc::Async:D:) {
nqp::closefh($!process_handle);
True;
Expand Down

0 comments on commit 124893c

Please sign in to comment.