FsPoll.hx 731 B

123456789101112131415161718192021222324252627282930
  1. package eval.luv;
  2. import eval.luv.File;
  3. /**
  4. Filesystem polling.
  5. @see https://aantron.github.io/luv/luv/Luv/FS_poll
  6. **/
  7. @:using(eval.luv.Handle)
  8. @:coreType abstract FsPoll to Handle {
  9. /**
  10. Allocates and initializes an FS polling handle.
  11. The handle should be cleaned up with `eval.luv.Handle.close` when no longer needed.
  12. **/
  13. static public function init(loop:Loop):Result<FsPoll>;
  14. /**
  15. Starts the handle and polls the given path for changes.
  16. The default value of `interval` is 2000 (milliseconds).
  17. **/
  18. public function start(path:NativeString, ?interval:Int, callback:(result:Result<{previous:FileStat,current:FileStat}>)->Void):Void;
  19. /**
  20. Stops the handle.
  21. **/
  22. public function stop():Result<Result.NoData>;
  23. }