Ubic-Service-Starman

 view release on metacpan or  search on metacpan

CHANGES  view on Meta::CPAN

  Date : 2012-04-19 23:32:12 +0000

    Add CHANGES File 

  Change: d7bfc037f174849def0ebe1794b2ca0fd74e8e9e
  Author: William Wolf <throughnothing@gmail.com>
  Date : 2012-04-19 23:18:02 +0000

    Fixed reload command (was broken)

    We didn't have access to the actual starman pid, and can't easily get
    it unless the --pid flag is sent, so we force it to be sent if it
    isn't sent by the user so that we can get the pid for a reload. 

------------------------------------------
version 0.001 at 2012-04-19 19:23:05 +0000
------------------------------------------

  Change: b485d3a5e3b8d0aa394f347db72dfc49721521a8
  Author: William Wolf <throughnothing@gmail.com>
  Date : 2012-04-19 15:23:05 +0000

README.md  view on Meta::CPAN

        port => 4444,
        ubic_log => '/var/log/app/ubic.log',
        stdout => '/var/log/app/stdout.log',
        stderr => '/var/log/app/stderr.log',
        user => "www-data",
    });

# DESCRIPTION

This service is a common ubic wrap for psgi applications.
It uses starman for running these applications.

It is a very simple wrapper around [Ubic::Service::Plack](http://search.cpan.org/perldoc?Ubic::Service::Plack) that
uses [starman](http://search.cpan.org/perldoc?starman) as the binary instead of [plackup](http://search.cpan.org/perldoc?plackup).  It
defaults the `server` argument to 'Starman' so you don't have to pass
it in, and adds the ability to reload (which will gracefully restart
your [Starman](http://search.cpan.org/perldoc?Starman) workers without any connections lost) using
`ubic reload service_name`.

# NAME

Ubic::Service::Starman - ubic service base class for psgi applications

# METHODS

README.pod  view on Meta::CPAN

        port => 4444,
        ubic_log => '/var/log/app/ubic.log',
        stdout => '/var/log/app/stdout.log',
        stderr => '/var/log/app/stderr.log',
        user => "www-data",
    });

=head1 DESCRIPTION

This service is a common ubic wrap for psgi applications.
It uses starman for running these applications.

It is a very simple wrapper around L<Ubic::Service::Plack> that
uses L<starman> as the binary instead of L<plackup>.  It
defaults the C<server> argument to 'Starman' so you don't have to pass
it in, and adds the ability to reload (which will gracefully restart
your L<Starman> workers without any connections lost) using
C<ubic reload service_name>.

=head1 NAME

Ubic::Service::Starman - ubic service base class for psgi applications

=head1 METHODS

lib/Ubic/Service/Starman.pm  view on Meta::CPAN

use strict;
use warnings;
package Ubic::Service::Starman;
{
  $Ubic::Service::Starman::VERSION = '0.004';
}

# Set the plackup bin to starman
sub BEGIN { $ENV{'UBIC_SERVICE_PLACKUP_BIN'} = 'starman'; }

use base qw(Ubic::Service::Plack);

# ABSTRACT: Helper for running psgi applications with Starman

sub new {
    my $class = shift;
    my $args = @_ > 1 ? { @_ } : $_[0];

    $args->{server} = 'Starman';
    my $obj = $class->SUPER::new( $args );
    # Default pid file for starman
    unless( $obj->{server_args}->{pid} ){
        # Set a pid for the starman server if one is not already set,
        # we'll need it for the reload command to work
        $obj->{server_args}->{pid} = $obj->pidfile . '.starman';
    }
    return $obj;
}

sub reload {
    my ( $self ) = @_;

    open FILE, $self->{server_args}->{pid} or die "Couldn't read pidfile";
    chomp(my $pid = <FILE>);

lib/Ubic/Service/Starman.pm  view on Meta::CPAN

        port => 4444,
        ubic_log => '/var/log/app/ubic.log',
        stdout => '/var/log/app/stdout.log',
        stderr => '/var/log/app/stderr.log',
        user => "www-data",
    });

=head1 DESCRIPTION

This service is a common ubic wrap for psgi applications.
It uses starman for running these applications.

It is a very simple wrapper around L<Ubic::Service::Plack> that
uses L<starman> as the binary instead of L<plackup>.  It
defaults the C<server> argument to 'Starman' so you don't have to pass
it in, and adds the ability to reload (which will gracefully restart
your L<Starman> workers without any connections lost) using
C<ubic reload service_name>.

=head1 NAME

Ubic::Service::Starman - ubic service base class for psgi applications

=head1 METHODS



( run in 0.637 second using v1.01-cache-2.11-cpan-e93a5daba3e )