Hi. Sorry for stupid question

Can somebody explain me why Mojo::IOLoop::Delay uses Hash::Util::FieldHash instead of normal attr?

From the doc.
Remaining "steps" <https://metacpan.org/pod/Mojo::IOLoop::Delay#steps> in chain, stored outside the object to protect from circular references.

How does that protect from circular references? This confuses because you may think that refs are weakened and
you can use it as a closure like

my $d = Mojo::IOLoop::Delay->new;
$d->steps( sub { $d->pass; });

But you can't, because it has the same effect as $d->{remaining} = [sub {$d}].

I thought a lot about why this solution was chosen, I have only one idea: you can destroy all steps from all delays, but I don't think that this is the reason because access to the %REMAINING isn't implemented at all

So maybe I miss a point... or maybe this is a mistake?

--
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to