IO::Mux::Bundle - logical group of connections


IO-Mux documentation  | view source Contained in the IO-Mux distribution.

Index


NAME

Top

IO::Mux::Bundle - logical group of connections

INHERITANCE

Top

 IO::Mux::Bundle
   is a IO::Mux::Handler::Read
   is a IO::Mux::Handler

 IO::Mux::Bundle
   is a IO::Mux::Handler::Write
   is a IO::Mux::Handler

 IO::Mux::Bundle is extended by
   IO::Mux::IPC

SYNOPSIS

Top

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

DESCRIPTION

Top

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

METHODS

Top

Constructors

IO::Mux::Bundle->new(OPTIONS)

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

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

fh => FILEHANDLE
name => STRING
read_size => INTEGER
stderr => IO::Mux::Handler::Read object
stdin => IO::Mux::Handler::Write object
stdout => IO::Mux::Handler::Read object
write_size => INTEGER

IO::Mux::Bundle->open(MODE, WHAT, OPTIONS) See "Constructors" in IO::Mux::Handler
IO::Mux::Bundle->open(MODE, WHAT, OPTIONS) See "Constructors" in IO::Mux::Handler

Accessors

$obj->connections
$obj->fh See "Accessors" in IO::Mux::Handler
$obj->fh See "Accessors" in IO::Mux::Handler
$obj->fileno See "Accessors" in IO::Mux::Handler
$obj->fileno See "Accessors" in IO::Mux::Handler
$obj->mux See "Accessors" in IO::Mux::Handler
$obj->mux See "Accessors" in IO::Mux::Handler
$obj->name See "Accessors" in IO::Mux::Handler
$obj->name See "Accessors" in IO::Mux::Handler
$obj->readSize([INTEGER]) See "Accessors" in IO::Mux::Handler::Read
$obj->stderr
$obj->stdin
$obj->stdout
$obj->usesSSL See "Accessors" in IO::Mux::Handler
$obj->usesSSL See "Accessors" in IO::Mux::Handler
$obj->writeSize([INTEGER]) See "Accessors" in IO::Mux::Handler::Write

User interface

Connection

$obj->close([CALLBACK]) See "Connection" in IO::Mux::Handler
$obj->close([CALLBACK]) See "Connection" in IO::Mux::Handler
$obj->timeout([TIMEOUT]) See "Connection" in IO::Mux::Handler
$obj->timeout([TIMEOUT]) See "Connection" in IO::Mux::Handler

Reading

$obj->readline(CALLBACK) See "Reading" in IO::Mux::Handler::Read
$obj->slurp(CALLBACK) See "Reading" in IO::Mux::Handler::Read

Writing

$obj->print(STRING|SCALAR|LIST|ARRAY) See "Writing" in IO::Mux::Handler::Write
$obj->printf(FORMAT, PARAMS) See "Writing" in IO::Mux::Handler::Write
$obj->say(STRING|SCALAR|LIST|ARRAY) See "Writing" in IO::Mux::Handler::Write
$obj->write(SCALAR, [MORE]) See "Writing" in IO::Mux::Handler::Write

Multiplexer

Connection

$obj->mux_init(MUX, [HANDLER]) See "Connection" in IO::Mux::Handler
$obj->mux_init(MUX, [HANDLER]) See "Connection" in IO::Mux::Handler
$obj->mux_remove See "Connection" in IO::Mux::Handler
$obj->mux_remove See "Connection" in IO::Mux::Handler
$obj->mux_timeout See "Connection" in IO::Mux::Handler
$obj->mux_timeout See "Connection" in IO::Mux::Handler

Reading

$obj->mux_eof(INPUT) See "Reading" in IO::Mux::Handler::Read
$obj->mux_except_flagged(FILENO) See "Reading" in IO::Mux::Handler
$obj->mux_except_flagged(FILENO) See "Reading" in IO::Mux::Handler
$obj->mux_input(BUFFER) See "Reading" in IO::Mux::Handler::Read
$obj->mux_read_flagged(FILENO) See "Reading" in IO::Mux::Handler
$obj->mux_read_flagged(FILENO) See "Reading" in IO::Mux::Handler

Writing

$obj->mux_outbuffer_empty See "Writing" in IO::Mux::Handler::Write
$obj->mux_output_waiting See "Writing" in IO::Mux::Handler::Write
$obj->mux_write_flagged(FILENO) See "Writing" in IO::Mux::Handler
$obj->mux_write_flagged(FILENO) See "Writing" in IO::Mux::Handler

Service

Errors

$obj->mux_error(BUFFER)

Called when new input has arrived on the error channel. It is passed a 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 mux_error
  {   my ($self, $errbuf) = @_;
      print STDERR $$errbuf;
      $$errbuf = '';
  } 

Helpers

$obj->extractSocket(HASH)
IO::Mux::Bundle->extractSocket(HASH) See "Helpers" in IO::Mux::Handler
$obj->extractSocket(HASH)
IO::Mux::Bundle->extractSocket(HASH) See "Helpers" in IO::Mux::Handler
$obj->fdset(STATE, READ, WRITE, ERROR) See "Helpers" in IO::Mux::Handler
$obj->fdset(STATE, READ, WRITE, ERROR) See "Helpers" in IO::Mux::Handler
$obj->show See "Helpers" in IO::Mux::Handler
$obj->show See "Helpers" in IO::Mux::Handler

SEE ALSO

Top

This module is part of IO-Mux distribution version 0.11, built on January 26, 2011. Website: http://perl.overmeer.net/ All modules in this suite: Any::Daemon, IO::Mux, and IO::Mux::HTTP.

Please post questions or ideas to perl@overmeer.net

LICENSE

Top

Copyrights 2011 by Mark Overmeer. 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 http://www.perl.com/perl/misc/Artistic.html


IO-Mux documentation  | view source Contained in the IO-Mux distribution.