=begin pod :kind("Type") :subkind("class") :category("domain-specific")

=TITLE class IO::Notification::Change

=SUBTITLE Changes in a file, produced by watch-file

    class IO::Notification::Change {}

C<IO::Notification.watch-path($path)> as well as
L<C<IO::Path.watch>|/type/IO::Path#method_watch> produce a
L<Supply|/type/Supply>
of C<IO::Notification::Change> events for a file or directory, depending on
what is used as the C<$path> argument or C<IO::Path> object.

Here is a small example that prints the first ten
C<FileChanged>-notifications for the current working directory:

=for code
my $finish = Promise.new;
my $count = 0;
IO::Notification.watch-path($*CWD).act( -> $change {
    $count++ if $change.event ~~ FileChanged;
    say "($count) $change.path(): $change.event()";
    $finish.keep if $count >= 10;
});
await $finish;

The type of the change is very much dependent both on the platform and
on specific system calls that were used to initiate the change. At this
point in time you should not rely on the type of change in general, and
test your particular situation.

=head1 Methods

=head2 method path

Returns the path of the file that's being watched.

=head2 method event

Returns the type of event: C<FileChanged> or C<FileRenamed>.

=head2 method IO

Returns a handle of the file that's being watched.

=head2 method gist

Defined as:

    multi method gist(IO::Notification::Change:D:)

Returns the path and event attributes, separated by semicolon.

=end pod
