txt: ## notification.md
  class IO::Notification
  
  Asynchronous notification for file and directory changes
  
  ```raku
  enum FileChangeEvent (:FileChanged(1), :FileRenamed(2));
  
  ```
  
  ```raku
  class IO::Notification {}
  
  ```
  
  Essentially, this class exists as a placeholder for the `IO::Notification.watch-path($path)` method, that produces a [`Supply`](/type/Supply) of [`IO::Notification::Change`](/type/IO/Notification/Change) events for a file or directory.
  
  # [Methods](#class_IO::Notification "go to top of document")[§](#Methods "direct link")
  
  ## [method watch-path](#class_IO::Notification "go to top of document")[§](#method_watch-path "direct link")
  
  ```raku
  method watch-path(IO::Notification: Str() $path, :$scheduler = $*SCHEDULER)
  
  ```
  
  Returns a [`Supply`](/type/Supply) that emits [`IO::Notification::Change`](/type/IO/Notification/Change) objects.
  
  If `$path` is a file, only modifications of that file are reported. If `$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.
  
  The `:$scheduler` named argument allows you to specify which thread scheduler is going to be responsible for the notification stream; it can be omitted if the default scheduler is used.
  
  ```raku
  my $supply = IO::Notification.watch-path( "/var/log/syslog" );
  
  $supply.tap( -> $v { say "Got ", $v });
  
  sleep 60;
  
  ```
  
  This snippet of code sets a watch on the system log file, emitting the kind of event that has occurred or capturing an error otherwise; the created [`Supply`](/type/Supply) is tapped, and the event printed. It does so for 60 minutes, emitting something like this:
  
  ｢text｣ without highlighting
  
  ```
  
  
  ```
  
  Got /var/log/syslog: FileChanged
  Got /var/log/syslog: FileChanged
  Got /var/log/syslog: FileChanged
  Got /var/log/syslog: FileChanged
  Got /var/log/syslog: FileChanged
  Got /var/log/syslog: FileChanged
  Got /var/log/syslog: FileChanged
  Got /var/log/syslog: FileChanged
  
  
  ```
  
  
  ```
  
  The only kind of information this method provides is the bare fact that something has change or been renamed. You will need to actually open and read the file or directory to check the actual changes.
  