Mojo::Redis2::Server - Start a test server
Mojo::Redis2::Server is a class for starting an instances of the Redis server. The server is stopped when the instance of this class goes out of scope.
Note: This module is only meant for unit testing. It is not good enough for keeping a production server up and running at this point.
use Mojo::Redis2::Server; { my $server = Mojo::Redis2::Server->new; $server->start; # server runs here } # server is stopped here
$hash_ref = $self->config;
Contains the full configuration of the Redis server.
$bool = $self->configure_environment; $self = $self->configure_environment($bool);
"start" will set the MOJO_REDIS_URL environment variable unless this attribute is set to false.
MOJO_REDIS_URL
$int = $self->pid;
The pid of the Redis server.
$str = $self->url;
Contains a value suitable for "url" in Mojo::Redis2.
$self = $class->singleton;
Returns the singleton which is used when "start" and "stop" is called as class methods, instead of instance methods.
$self = $self->start(%config);
This method will try to start an instance of the Redis server or die() trying. The input config is a key/value structure with valid Redis config file settings.
die()
$self = $self->stop;
Will stop a running Redis server or die trying.
Copyright (C) 2014, Jan Henning Thorsen
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
Jan Henning Thorsen - jhthorsen@cpan.org
jhthorsen@cpan.org
To install Mojo::Redis2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojo::Redis2
CPAN shell
perl -MCPAN -e shell install Mojo::Redis2
For more information on module installation, please visit the detailed CPAN module installation guide.