Skip to content

Commit

Permalink
rename 'service' to 'manager'
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmay committed Jun 5, 2011
1 parent c82be7a commit c3428f8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bin/termcast-server-telnet.pl
Expand Up @@ -11,6 +11,6 @@

my $socket = Cwd::abs_path($ARGV[0]);

my $app = App::Termcast::Server::Telnet->new(service_socket_path => $socket);
my $app = App::Termcast::Server::Telnet->new(manager_socket_path => $socket);

$app->run();
20 changes: 10 additions & 10 deletions lib/App/Termcast/Server/Telnet.pm
Expand Up @@ -10,20 +10,20 @@ use IO qw(Socket::UNIX Socket::INET);
use YAML ();
use JSON ();

has service_socket_path => (
has manager_socket_path => (
is => 'ro',
isa => 'Str',
required => 1,
);

has service_socket => (
has manager_socket => (
is => 'ro',
isa => 'FileHandle',
block => sub {
my ($service, $self) = @_;
my ($manager, $self) = @_;

my $socket = IO::Socket::UNIX->new(
Peer => $self->service_socket_path,
Peer => $self->manager_socket_path,
) or die $!;

my $req_string = JSON::encode_json({request => 'sessions'});
Expand Down Expand Up @@ -85,14 +85,14 @@ has telnet_acceptor => (
},
);

has service_stream => (
has manager_stream => (
is => 'ro',
isa => __PACKAGE__.'::Stream::Service',
isa => __PACKAGE__.'::Stream::Manager',
lifecycle => 'Singleton',
dependencies => {
connection_pool => 'connection_pool',
session_pool => 'session_pool',
handle => 'service_socket',
handle => 'manager_socket',
telnet_dispatcher => 'telnet_dispatcher',
},
);
Expand All @@ -104,16 +104,16 @@ has telnet_dispatcher => (
lifecycle => 'Singleton',
);

has service_dispatcher => (
has manager_dispatcher => (
is => 'ro',
isa => __PACKAGE__.'::Dispatcher::Service',
isa => __PACKAGE__.'::Dispatcher::Manager',
lifecycle => 'Singleton',
);

sub run {
my $self = shift;

$self->watch($self->service_stream);
$self->watch($self->manager_stream);
$self->watch($self->telnet_acceptor);

$self->run_all();
Expand Down
@@ -1,4 +1,4 @@
package App::Termcast::Server::Telnet::Dispatcher::Service;
package App::Termcast::Server::Telnet::Dispatcher::Manager;
use Moose;

sub dispatch {
Expand Down
@@ -1,4 +1,4 @@
package App::Termcast::Server::Telnet::Stream::Service;
package App::Termcast::Server::Telnet::Stream::Manager;
use Moose;
extends 'Reflex::Stream';

Expand Down Expand Up @@ -74,7 +74,7 @@ sub on_data {

if ($data->{sessions}) {
if (not ref $data->{sessions} or ref($data->{sessions}) ne 'ARRAY') {
warn 'invalid data into service stream: invalid "sessions" key';
warn 'invalid data into manager stream: invalid "sessions" key';
return;
}

Expand Down

0 comments on commit c3428f8

Please sign in to comment.