Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Index FileChangedEvent closes #1558
  • Loading branch information
JJ committed Jul 10, 2018
1 parent 535144c commit 0264be3
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions doc/Type/IO/Notification.pod6
Expand Up @@ -4,7 +4,9 @@
=SUBTITLE Asynchronous notification for file and directory changes
X<|IO::Notification::Change>
X<|FileChangeEvent (enum)>
X<|FileChanged (FileChangeEvent)>
X<|FileRenamed (FileChangeEvent)>
=for code
enum FileChangeEvent (:FileChanged(1), :FileRenamed(2));
=for code :skip-test
Expand All @@ -16,11 +18,11 @@ class IO::Notification {
...
}
C<IO::Notification.watch-path($path)> produces a L<Supply|/type/Supply> of
C<IO::Notification::Change> events for a file or directory.
C<IO::Notification.watch-path($path)> produces a L<Supply|/type/Supply>
of C<IO::Notification::Change> events for a file or directory.
Here is a small example that prints the first ten FileChanged-notifications for
the current working directory:
Here is a small example that prints the first ten
C<FileChanged>-notifications for the current working directory:
=for code
my $finish = Promise.new;
Expand All @@ -32,10 +34,10 @@ IO::Notification.watch-path($*CWD).act( -> $change {
});
await $finish;
The type of the change is very much dependent both on the platform and on
specific system calls that were used initiate the change. At this point in time
you should not rely on the type of change in general, and test your particular
situation.
The type of the change is very much dependent both on the platform and
on specific system calls that were used 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
Expand All @@ -48,10 +50,10 @@ Returns a L<Supply|/type/Supply> that emits C<IO::Notification::Change> objects.
If C<$path> is a file, only modifications of that file are reported. If
C<$path> is a directory, both modifications to the directory itself (for
example permission changes) and to files in the directory (including new files
in the directory) are reported.
example permission changes) and to files in the directory (including new
files in the directory) are reported.
C<:$scheduler> allows you to specify which thread scheduler is responsible
for the notification stream.
C<:$scheduler> allows you to specify which thread scheduler is
responsible for the notification stream.
=end pod

0 comments on commit 0264be3

Please sign in to comment.