G'day.  I hope this is the right place to discuss these issues.

It looks like the MooseX::Daemonize role and MooseX::Declare are not playing
nicely together; I think I understand why this is, but I don't quite see what
the solution is.

Specifically, MooseX::Daemonize defines a bunch of methods that are extended
to implement the actions of the software; specifically 'start' and 'stop':

    package Example;
    use Moose; with 'MooseX::Daemonize';
    after 'start' => sub { say "running now..." };

Meanwhile, MooseX::Declare delays loading of roles until *after* the
definition of the class, which means that this does not work:

    class Example with MooseX::Daemonize {
        after start () { say "running now..." };
    }

Specifically, when run that gives:

The method 'start' was not found in the inheritance hierarchy for CABAL at
    /usr/lib/perl5/Class/MOP/Class.pm line 651


I suspect the right answer is "don't do that", which is the strategy I am
going to implement in the near-term, but I am curious:

Which code is in the "wrong" here — MooseX::Daemonize, or MooseX::Declare?

By "wrong" I mean, which of the two is making an assumption that isn't
supported by Moose, or are they both doing fine, and just not compatible?

Regards,
        Daniel
-- 
✣ Daniel Pittman            ✉ [email protected]            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons

Reply via email to