1 package App::Clifton::Component;
3 # define this up here to avoid uninitialised warnings
5 my ($self, $args) = @_;
6 "${self}: ".join ', ', map "$_ => ".$args->{$_}, keys %$args;
9 use Log::Contextual qw(:log);
12 extends 'IO::Async::Notifier';
15 my ($self, $args) = @_;
17 "Constructing "._debug_self($self, $args);
19 if (my $parent = $args->{parent_component}) {
20 $parent->add_child($self);
25 # If we called the superclass method, any ->new params that were populated
26 # into attributes would cause a croak. While the loss of error checking is
27 # annoying I've got other things to fix right now.
31 my ($self, $class, $args) = @_;
32 $class->new(%{$args||{}}, parent_component => $self);
36 my ($self, $code) = @_;
37 $self->get_loop->later($code);
42 log_debug { "Destroying "._debug_self($self, $self) };