=encoding utf8

=head1 NAME

IOMux::Bundle - logical group of connections

=head1 INHERITANCE

 IOMux::Bundle
   is an IOMux::Handler::Read
   is an IOMux::Handler

 IOMux::Bundle
   is an IOMux::Handler::Write
   is an IOMux::Handler

 IOMux::Bundle is extended by
   IOMux::IPC

=head1 SYNOPSIS

  my $syscall = IOMux::Bundle::Parallel->new(...);
  $mux->add($syscall);

=head1 DESCRIPTION

A bundle is a set of file handles, so a convenience wrapper around
a set of different connections with a single purpose.

Take stdin, stdout and stderr from the viewpoint of a client process
which starts an external command.  So, B<stdin will write> to the stdin
of the remote process, etc.

Extends L<"DESCRIPTION" in IOMux::Handler::Write|IOMux::Handler::Write/"DESCRIPTION">.
 
Extends L<"DESCRIPTION" in IOMux::Handler::Read|IOMux::Handler::Read/"DESCRIPTION">.
 
=head1 METHODS

Extends L<"METHODS" in IOMux::Handler::Write|IOMux::Handler::Write/"METHODS">.
 
Extends L<"METHODS" in IOMux::Handler::Read|IOMux::Handler::Read/"METHODS">.
 
=head2 Constructors

Extends L<"Constructors" in IOMux::Handler::Write|IOMux::Handler::Write/"Constructors">.
 
Extends L<"Constructors" in IOMux::Handler::Read|IOMux::Handler::Read/"Constructors">.
 
=over 4

=item IOMux::Bundle-E<gt>B<new>(%options)

The C<stdin>, C<stdout> and C<stderr> objects are from the perspective
of the other side.

 -Option    --Defined in           --Default
  fh          IOMux::Handler         <required>
  name        IOMux::Handler         <stringified handle>
  read_size   IOMux::Handler::Read   32768
  stderr                             <undef>
  stdin                              <required>
  stdout                             <required>
  write_size  IOMux::Handler::Write  4096

=over 2

=item fh => FILEHANDLE

=item name => STRING

=item read_size => INTEGER

=item stderr => L<IOMux::Handler::Read|IOMux::Handler::Read>   object

=item stdin => L<IOMux::Handler::Write|IOMux::Handler::Write>  object

=item stdout => L<IOMux::Handler::Read|IOMux::Handler::Read>   object

=item write_size => INTEGER

=back

=item IOMux::Bundle-E<gt>B<open>($mode, $what, %options)

Inherited, see L<IOMux::Handler/"Constructors">

=item IOMux::Bundle-E<gt>B<open>($mode, $what, %options)

Inherited, see L<IOMux::Handler/"Constructors">

=back

=head2 Accessors

Extends L<"Accessors" in IOMux::Handler::Write|IOMux::Handler::Write/"Accessors">.
 
Extends L<"Accessors" in IOMux::Handler::Read|IOMux::Handler::Read/"Accessors">.
 
=over 4

=item $obj-E<gt>B<connections>()

=item $obj-E<gt>B<fh>()

Inherited, see L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<fh>()

Inherited, see L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<fileno>()

Inherited, see L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<fileno>()

Inherited, see L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<mux>()

Inherited, see L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<mux>()

Inherited, see L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<name>()

Inherited, see L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<name>()

Inherited, see L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<readSize>( [$integer] )

Inherited, see L<IOMux::Handler::Read/"Accessors">

=item $obj-E<gt>B<stderr>()

=item $obj-E<gt>B<stdin>()

=item $obj-E<gt>B<stdout>()

=item $obj-E<gt>B<usesSSL>()

Inherited, see L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<usesSSL>()

Inherited, see L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<writeSize>( [$integer] )

Inherited, see L<IOMux::Handler::Write/"Accessors">

=back

=head2 User interface

Extends L<"User interface" in IOMux::Handler::Write|IOMux::Handler::Write/"User interface">.
 
Extends L<"User interface" in IOMux::Handler::Read|IOMux::Handler::Read/"User interface">.
 
=head2 Multiplexer

Extends L<"Multiplexer" in IOMux::Handler::Write|IOMux::Handler::Write/"Multiplexer">.
 
Extends L<"Multiplexer" in IOMux::Handler::Read|IOMux::Handler::Read/"Multiplexer">.
 
=head3 Connection

Extends L<"Connection" in IOMux::Handler::Write|IOMux::Handler::Write/"Connection">.
 
Extends L<"Connection" in IOMux::Handler::Read|IOMux::Handler::Read/"Connection">.
 
=over 4

=item $obj-E<gt>B<muxInit>( $mux, [$handler] )

Inherited, see L<IOMux::Handler/"Connection">

=item $obj-E<gt>B<muxInit>( $mux, [$handler] )

Inherited, see L<IOMux::Handler/"Connection">

=item $obj-E<gt>B<muxRemove>()

Inherited, see L<IOMux::Handler/"Connection">

=item $obj-E<gt>B<muxRemove>()

Inherited, see L<IOMux::Handler/"Connection">

=item $obj-E<gt>B<muxTimeout>()

Inherited, see L<IOMux::Handler/"Connection">

=item $obj-E<gt>B<muxTimeout>()

Inherited, see L<IOMux::Handler/"Connection">

=back

=head3 Reading

Extends L<"Reading" in IOMux::Handler::Write|IOMux::Handler::Write/"Reading">.
 
Extends L<"Reading" in IOMux::Handler::Read|IOMux::Handler::Read/"Reading">.
 
=over 4

=item $obj-E<gt>B<muxEOF>($input)

Inherited, see L<IOMux::Handler::Read/"Reading">

=item $obj-E<gt>B<muxExceptFlagged>($fileno)

Inherited, see L<IOMux::Handler/"Reading">

=item $obj-E<gt>B<muxExceptFlagged>($fileno)

Inherited, see L<IOMux::Handler/"Reading">

=item $obj-E<gt>B<muxInput>($buffer)

Inherited, see L<IOMux::Handler::Read/"Reading">

=item $obj-E<gt>B<muxReadFlagged>($fileno)

Inherited, see L<IOMux::Handler/"Reading">

=item $obj-E<gt>B<muxReadFlagged>($fileno)

Inherited, see L<IOMux::Handler/"Reading">

=back

=head3 Writing

Extends L<"Writing" in IOMux::Handler::Write|IOMux::Handler::Write/"Writing">.
 
Extends L<"Writing" in IOMux::Handler::Read|IOMux::Handler::Read/"Writing">.
 
=over 4

=item $obj-E<gt>B<muxOutbufferEmpty>()

Inherited, see L<IOMux::Handler::Write/"Writing">

=item $obj-E<gt>B<muxOutputWaiting>()

Inherited, see L<IOMux::Handler::Write/"Writing">

=item $obj-E<gt>B<muxWriteFlagged>($fileno)

Inherited, see L<IOMux::Handler/"Writing">

=item $obj-E<gt>B<muxWriteFlagged>($fileno)

Inherited, see L<IOMux::Handler/"Writing">

=back

=head3 Service

Extends L<"Service" in IOMux::Handler::Write|IOMux::Handler::Write/"Service">.
 
Extends L<"Service" in IOMux::Handler::Read|IOMux::Handler::Read/"Service">.
 
=head3 Errors

=over 4

=item $obj-E<gt>B<muxError>($buffer)

Called when new input has arrived on the error channel. It is passed a
B<reference> to the error $buffer. It must remove any input that it you
have consumed from the $buffer, and leave any partially received data
in there for more text to arrive.

example: 

  # actually, this is the default behavior
  sub muxError
  {   my ($self, $errbuf) = @_;
      print STDERR $$errbuf;
      $$errbuf = '';
  } 

=back

=head2 Helpers

Extends L<"Helpers" in IOMux::Handler::Write|IOMux::Handler::Write/"Helpers">.
 
Extends L<"Helpers" in IOMux::Handler::Read|IOMux::Handler::Read/"Helpers">.
 
=over 4

=item $obj-E<gt>B<extractSocket>(HASH)

=item IOMux::Bundle-E<gt>B<extractSocket>(HASH)

Inherited, see L<IOMux::Handler/"Helpers">

=item $obj-E<gt>B<extractSocket>(HASH)

=item IOMux::Bundle-E<gt>B<extractSocket>(HASH)

Inherited, see L<IOMux::Handler/"Helpers">

=item $obj-E<gt>B<fdset>($state, $read, $write, $error)

Inherited, see L<IOMux::Handler/"Helpers">

=item $obj-E<gt>B<fdset>($state, $read, $write, $error)

Inherited, see L<IOMux::Handler/"Helpers">

=item $obj-E<gt>B<show>()

Inherited, see L<IOMux::Handler/"Helpers">

=item $obj-E<gt>B<show>()

Inherited, see L<IOMux::Handler/"Helpers">

=back

=head1 SEE ALSO

This module is part of IOMux distribution version 1.01,
built on January 15, 2020. Website: F<http://perl.overmeer.net/CPAN>

=head1 LICENSE

Copyrights 2011-2020 by [Mark Overmeer <markov@cpan.org>]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
See F<http://dev.perl.org/licenses/>

