toddr / Net-Daemon

Read-only release history for Net-Daemon
http://metacpan.org/release/Net-Daemon
0 stars 0 forks source link

Demo-code (partially) non-functional [rt.cpan.org #70890] #2

Open toddr opened 3 years ago

toddr commented 3 years ago

Migrated from rt.cpan.org#70890 (status was 'new')

Requestors:

From pjotrekse@gmail.com on 2011-09-12 10:59:56 :

Demo code :

sub new ($$;$) {
      my($class, $attr, $args) = @_;
      my($self) = $class->SUPER::new($attr, $args);
      if ($self->{'parent'}) {
          # Called via Clone()
      ...

will never work, as a cloned instance never passes the 'new' function.

Inserting print statements in Net::Daemon methods 'new', 'Clone' and 
'Run', and in subclass' 'new' and 'Run' methods prove that no 'new' 
method is passed by instances made with 'Clone'.

Suggestion:
Make a method i.e. 'initiate-clone', that is called before 'Run', and 
that can be overridden in the subclass to perform necessary initiation, 
that is now non-functional in the demo-code.
toddr commented 3 years ago

Pull requests welcome.