1 package App::Clifton::Server;
3 use aliased 'App::Clifton::ServiceContainer';
4 use aliased 'App::Clifton::ConfigLoader';
7 extends 'App::Clifton::Service';
10 my ($self, $args) = @_;
11 $args->{loop}->add($self);
12 $self->$_ for qw(services);
15 has config_file => (is => 'ro', required => 1);
17 has config_loader => (is => 'lazy');
19 sub _build_config_loader { ConfigLoader->new }
21 has services => (is => 'lazy');
24 shift->_new_child(ServiceContainer, {});
27 sub reload_config { shift->_do(reload_config => @_) }
28 sub shutdown { shift->_do(shutdown => @_) }
30 sub _body_for_reload_config {
31 my ($self, $args) = @_;
32 $args->{on_finished}->();