(clojurize event watched-path)
Inputs: [event :- WatchEvent watched-path :- Path] Returns: Event
Takes the Java WatchEvent and the watchable Java Path that the event occurred within and creates a Clojure map to represent the Event throughout the system. The watched-path key is the registered watchable, the changed-path the relative path to what changed, and the full path is the absolute path to the changed event (watched-path + changed-path).
Inputs: [event :- WatchEvent watched-path :- Path] Returns: Event Takes the Java WatchEvent and the watchable Java Path that the event occurred within and creates a Clojure map to represent the Event throughout the system. The watched-path key is the registered watchable, the changed-path the relative path to what changed, and the full path is the absolute path to the changed event (watched-path + changed-path).
(process-events! watcher events)
Inputs: [watcher :- (schema/protocol Watcher) events :- [Event]]
Process for side-effects any events that occured for watcher's watch-key
Inputs: [watcher :- (schema/protocol Watcher) events :- [Event]] Process for side-effects any events that occured for watcher's watch-key
(retrieve-events watcher)
Inputs: [watcher :- (schema/protocol Watcher)] Returns: [Event]
Blocks until an event the watcher is concerned with has occured. Will then
poll for a new event, waiting at least window-min
for a new event to
occur. Will continue polling for as long as there are new events that occur
within window-min
, or the window-max
time limit has been exceeded.
Inputs: [watcher :- (schema/protocol Watcher)] Returns: [Event] Blocks until an event the watcher is concerned with has occured. Will then poll for a new event, waiting at least `window-min` for a new event to occur. Will continue polling for as long as there are new events that occur within `window-min`, or the `window-max` time limit has been exceeded.
(validate-watch-options! options)
Validate that the options supplied include a valid Boolean value for key :recursive.
Validate that the options supplied include a valid Boolean value for key :recursive.
(watch! watcher shutdown-fn)
Inputs: [watcher :- (schema/protocol Watcher) shutdown-fn :- IFn]
Creates a future and processes events for the passed in watcher. The future will continue until the underlying WatchService is closed.
Inputs: [watcher :- (schema/protocol Watcher) shutdown-fn :- IFn] Creates a future and processes events for the passed in watcher. The future will continue until the underlying WatchService is closed.
(watch-key->events watch-key)
Inputs: [watch-key :- WatchKey] Returns: [Event]
Inputs: [watch-key :- WatchKey] Returns: [Event]
(watch-new-directories! events watcher)
Inputs: [events :- [Event] watcher :- (schema/protocol Watcher)]
Given an initial set of events and a watcher, identify any events that represent the creation of a directory and register them with the watch service. If no events are directory creations, nothing is registered.
Inputs: [events :- [Event] watcher :- (schema/protocol Watcher)] Given an initial set of events and a watcher, identify any events that represent the creation of a directory and register them with the watch service. If no events are directory creations, nothing is registered.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close