Alfie John > MySQL-Replication > MySQL::Replication::Command

Download:
MySQL-Replication-0.0.2.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.0.1   Source  

NAME ^

MySQL::Replication::Command - Encapsulation of MySQL::Replication IPC

SYNOPSIS ^

  my $Request = MySQL::Replication::Command->new(
    Command => 'GET',
    Headers => {
      Host     => $Host,
      Binlog   => $Binlog,
      StartLog => $StartLog,
      StartPos => $StartPos,
    },
  );

  $Request->SendToSocket( $Socket,
    NonBlocking => $NonBlocking,
  );

  my $Response = MySQL::Replication::Command->NewFromSocket(
    Socket      => $Socket,
    Buffer      => $Buffer,
    NonBlocking => $NonBlocking,    
  ); 

  print $Response->Stringify();

DESCRIPTION ^

MySQL::Replication::Command contains convenience methods to encapsulate MySQL::Replication interprocess communication.

METHODS ^

new

  my $Response = MySQL::Replication::Command->new(
    Command => 'QUERY',
    Headers => {
      Timestamp => $Timestamp,
      Database  => $Database,
      Log       => $Log,
      Pos       => $Pos,
      Length    => $Length,
    },
    Body    => $Body,
  );

new() creates a command.

If the return value was undef, inspect $MySQL::Replication::Command::Errstr for an error message.

Parameters

NewFromSocket

  my $Response = MySQL::Replication::Command->NewFromSocket(
    Socket      => $Socket,
    Buffer      => $Buffer,
    NonBlocking => $NonBlocking,    
  ); 

NewFromSocket() reads a command from the socket.

If the return value was undef, inspect $MySQL::Replication::Command::Errstr for an error message.

Parameters

SendToSocket

  $Request->SendToSocket( $Socket,
    NonBlocking => $NonBlocking,
  );

SendToSocket() writes the command to the socket.

If the return value was undef, inspect $MySQL::Replication::Command::Errstr for an error message.

Parameters

Stringify

  print $Response->Stringify();

Stringify() returns the stringification of the command. This is what gets written to the socket in SendToSocket().

BUGS ^

Please report any bugs or feature requests to bug-mysql-replication at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MySQL-Replication.

AUTHOR ^

Alfie John, alfiej at opera.com

LICENSE AND COPYRIGHT ^

Copyright (c) 2011, Opera Software Australia Pty. Ltd. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  * Redistributions of source code must retain the above copyright notice,
    this list of conditions and the following disclaimer.
  * Redistributions in binary form must reproduce the above copyright notice,
    this list of conditions and the following disclaimer in the documentation
    and/or other materials provided with the distribution.
  * Neither the name of the copyright holder nor the names of its contributors
    may be used to endorse or promote products derived from this software
    without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

syntax highlighting: