Carsten,
Thanks again for your work on this issue, and for your feedback.
In response to your questions about the idea of combining the MOVED_FROM and MOVED_TO pair of events events into a single AEFN::Event, I would say:
(1) The AEFN::Event data structure would have to be modified to carry both paths.
(2) Yes, the first event would have to be stored, in a hash or an array, until the second event arrives. In the case of a Move event, the two events happen almost simultaneously. So there would be essentially no delay from combining them.
Nevertheless, this would be a separate project, and is beyond the scope of the bugfix. It's just an idea that could potentially simplify the processing of Move notifications. I am not planning to submit an implementation.
Best,
--Jonathan
On Mon Dec 09 08:35:47 2013, carsten@wolffcarsten.de wrote:
Show quoted text> Hi Jonathan,
>
> Jonathan wrote:
> > Thanks, Carsten. The patch looks OK to me.
>
> thanks for the review.
>
> > - Your change could break existing code that uses AEFN. In my
> > opinion, it
> > should be possible for someone to upgrade without breaking anything.
> > If
> > you're going to change the event behavior as described, make it
> > backward-compatible.
>
> Sure, that makes sense. Find attached a v2 of the patch.
>
> > - Is it possible that $self->cb might be undef? If so, your code
> > would
> > crash when you try to apply it at the end of the sub.
>
> No, the member var has "required => 1".
>
> > - Would it make sense to synthesize a single "moved" AEFN:Event from
> > the
> > two MOVED_FROM and MOVED_TO events? That would be really cool and
> > useful.
>
> I see two problems with this idea:
> 1. A single AEFN event has only one "path". How would you transport
> the
> information about old and new name together in one Event?
> 2. The Linux::Inotify2 watcher only passes one event at a time to the
> callback
> (_process_events). To associate and/or merge two events with each
> other, there
> would need to exist a local event-queue which would hold and delay
> the first
> event up to the arrival of the second.
>
> Cheers
> Carsten