=encoding utf8

=head1 NAME

IOMux::File::Read - write to file

=head1 INHERITANCE

 IOMux::File::Read
   is an IOMux::Handler::Read
   is an IOMux::Handler

=head1 SYNOPSIS

  my $mux = IOMux::Select->new;  # or ::Poll

  use IOMux::Open '<';
  my $file = $mux->open('<', $filename);

  use IOMux::File::Read;
  my $file = IOMux::File::Read->new(file => $filename);
  $mux->add($file);

  $file->getline(sub {print "\n"});

=head1 DESCRIPTION

In an event driven program, reading is harder to use than writing: the
read will very probably be stalled until data has arrived, so you will
need a callback to handle the resulting data.

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

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

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

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

 -Option   --Defined in          --Default
  exclusive                        <false>
  fh         IOMux::Handler        <required>
  file                             <required>
  mode                             '<'
  modeflags                        <undef>
  name       IOMux::Handler        '<$file'
  read_size  IOMux::Handler::Read  32768

=over 2

=item exclusive => BOOLEAN

=item fh => FILEHANDLE

=item file => FILENAME|HANDLE

=item mode => '<'

For now, the mode is always simply 'read'

=item modeflags => INTEGER

When defined, the C<exclusive> option is not used, but your value is
taken. Use constants defined by Fcntl.
Do not forget to include C<O_NONBLOCK>.

=item name => STRING

=item read_size => INTEGER

=back

=item IOMux::File::Read-E<gt>B<open>($mode, $file, %options)

=back

=head2 Accessors

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

=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<mode>()

The bits of the open mode.

=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<readSize>( [$integer] )

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

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

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

=back

=head2 User interface

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

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

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

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

=item IOMux::File::Read-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<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/>