=begin pod :kind("Type") :subkind("class") :category("exception")

=TITLE class X::Proc::Async::BindOrUse

=SUBTITLE Error due to trying to bind a handle that is also used

=for code :preamble<role X::Proc::Async {}>
class X::Proc::Async::BindOrUse does X::Proc::Async {}

In general, it occurs when there's some mistake in the direction the stream
flows, for instance:

=for code
my $p = Proc::Async.new("ls", :w);
my $h = "ls.out".IO.open(:w);
$p.bind-stdin($h);
# Fails with OUTPUT: «Cannot both bind stdin to a handle and also use :w␤»

In this case, C<stdin> is already bound and cannot be used again; one of them
should flow C<:out> and the other one C<:w> to work correctly.

=end pod

# vim: expandtab shiftwidth=4 ft=perl6
