Max Maischein > MozRepl-RemoteObject-0.36 > MozRepl::AnyEvent

Download:
MozRepl-RemoteObject-0.36.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Module Version: 0.36   Source   Latest Release: MozRepl-RemoteObject-0.39

NAME ^

MozRepl::AnyEvent - AnyEvent-enabled MozRepl client

SYNOPSIS ^

  use MozRepl::RemoteObject;
  $ENV{ MOZREPL_CLASS } = 'MozRepl::AnyEvent';
  my $bridge = MozRepl::RemoteObject->install_bridge();

This module provides a compatible API to MozRepl solely for what MozRepl::RemoteObject uses. It does not provide plugin support. If you want a fully compatible AnyEvent-enabled MozRepl, please consider porting Net::Telnet to AnyEvent::Handle.

Instead of using the process environment, you can also pass the backend class using the repl_class parameter in the constructor:

  use MozRepl::RemoteObject;
  my $bridge = MozRepl::RemoteObject->install_bridge(
      repl_class => 'MozRepl::AnyEvent',
  );

The module in repl_class will be loaded through require. If the module does not load, the fatal error will propagate. No fallbacks are tried.

METHODS ^

MozRepl::AnyEvent->new( %options )

Creates a new instance.

Options

$repl->log( $level, @info )

Prints the information to STDERR if logging is enabled for the level.

$repl->setup_async( $options )

  my $repl = MozRepl::AnyEvent->setup({
      client => { host => 'localhost',
                  port => 4242,
                },
       log   => ['debug'],
       cv    => $cv,
  });

Sets up the repl connection. See MozRepl::setup for detailed documentation.

The optional CV will get the repl through ->send().

Returns the CV to wait on that signals when setup is done.

$repl->setup(...)

Synchronous version of ->setup_async, provided for API compatibility. This one will do a ->recv call inside.

$repl->repl

Returns the name of the repl in Firefox.

$repl->hdl

Returns the socket handle of the repl.

$repl->execute_async( $command, $cb )

    my $cv = $repl->execute_async( '1+1' );
    # do stuff
    my $two = $cv->recv;
    print "1+1 is $two\n";

Sends a command to Firefox for execution. Returns the condvar to wait for the response.

$repl->execute( ... )

Synchronous version of ->execute_async. Internally calls ->recv. Provided for API compatibility.

SEE ALSO ^

MozRepl for the module defining the API

AnyEvent for AnyEvent

REPOSITORY ^

The public repository of this module is http://github.com/Corion/mozrepl-remoteobject.

AUTHOR ^

Max Maischein corion@cpan.org

COPYRIGHT (c) ^

Copyright 2009-2012 by Max Maischein corion@cpan.org.

LICENSE ^

This module is released under the same terms as Perl itself.

syntax highlighting: