= 1;
use Getopt::Long qw(:config pass_through);
use Unicorn::Manager::CLI;
use IO::Socket;
use JSON;
my $HELP = <<"END";
Synopsis
$0 [action] [options]
Actions
help
show this help
my $data = {
query => $query,
args => [@args],
};
my $json = JSON->new->utf8(1);
my $sock = IO::Socket::INET->new(
PeerAddr => $host || 'l
PeerPort => $port || 4242,
Proto => 'tcp',
);
my $json_string = $json->encode($data);
my $res;
if ( not $sock ) {
say "Apparently
return $self->ptable($tree) ? 1 : 0;
}
1;
package Unicorn::Manager::CLI::Proc;
use Moo;
use JSON;
use strict;
use warnings;
use autodie;
use 5.010;
has process_table => ( is => 'rw', );
sub BU
self = shift;
$self->process_table->refresh;
}
sub as_json {
my $self = shift;
my $json = JSON->new->utf8(1);
return $json->encode( { $self->as_hash } );
}
sub as_hash {
my $se
es the process table.
$uniman_proc->refresh;
=head2 as_json
Return process table as json.
my $json_text = $uniman_proc->as_json;
=head2 as_hash
Return process table as hash.
my %has
ift;
my $message = shift;
my $data = shift;
my $json = JSON->new->utf8(1);
return $json->encode(
{
status => $status,
the encode->decode->encode
return $render->( 1, 'running unicorns', JSON::decode_json( $self->proc->as_json ) );
},
help => sub {
my $help = {
se warnings;
use autodie;
use 5.010;
use Unicorn::Manager::CLI;
use Unicorn::Manager::Types;
use JSON;
use Try::Tiny;
extends 'Net::Server::PreFork';
has listen => (
is => 'rw',
isa => Uni
rw' );
has user => ( is => 'rw' );
has group => ( is => 'rw' );
has cli => ( is => 'rw' );
has json => ( is => 'rw' );
sub BUILD {
my $self = shift;
$self->user('nobody') unless $s
unless $self->port;
$self->listen('localhost') unless $self->listen;
$self->json( JSON->new->utf8(1) );
$self->cli( Unicorn::Manager::CLI->new( username => $self->user ) ) unles
nager::Server;
use 5.010;
use feature 'say';
use strict;
use warnings;
use autodie;
use Moo;
use JSON;
use Try::Tiny;
use Unicorn::Manager::Server::PreFork;
has listen => (
is => 'rw',
isa
=head1 VERSION
Version 0.006009
=head1 SYNOPSIS
The Unicorn::Manager::Server module provides a json interface to query information about running unicorn processes and users.
Also some assumption a