What confuses me is that I was previously using Mojo::Pg::PubSub and
this works:
On May 24, 2016 7:23 AM, "Heiko Jansen" <heiko.j...@gmail.com> wrote:
>
> I think it works like this:
> https://metacpan.org/source/SRI/Mojo-Pg-2.27/lib/Mojo/Pg/PubSub.pm#L14 keeps a reference to the callback inside the Mojo::Pg::PubSub object. And the Mojo::Pg::PubSub object is referenced from Mojolicious. So the reference counter of the callback does not reach 0.
> In your Inotifier code nothing outside wsinit() retains a reference to the callback once wsinit() is left (the Inotifier::Model::FileWatch theoretically might, but that object also gets destroyed when leaving wsinit()).
>
That would explain it. I may look at a similar approach for my code.
Thanks,
John