(->tuple event)
Create a tuple of the two fields we care about in an Event. This simple element querying our sets simple.
Create a tuple of the two fields we care about in an Event. This simple element querying our sets simple.
(already-seen? events {:keys [changed-path type] :as _event})
Expects a set of event tuples (see ->tuple) and a full Event. Is this a modify event for a changed-path where we've already seen a create or modify event?
Expects a set of event tuples (see ->tuple) and a full Event. Is this a modify event for a changed-path where we've already seen a create or modify event?
(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 occurred for watcher's watch-key
Inputs: [watcher :- (schema/protocol Watcher) events :- [Event]] Process for side effects any events that occurred 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 occurred. 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 occurred. 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.
(should-overwrite? events {:keys [changed-path type] :as _event})
Expects a set of event tuples (see ->tuple) and a full Event. Is this a create event that should supersede a previously found modify or create event?
Expects a set of event tuples (see ->tuple) and a full Event. Is this a create event that should supersede a previously found modify or create event?
(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 stopped?)
Inputs: [watcher :- (schema/protocol Watcher) shutdown-fn :- IFn stopped? :- (schema/atom schema/Bool)] Returns: Future
Creates and returns a future. Processes events for the passed in watcher within the context of that future. The future will continue until the underlying WatchService is closed, or the future is interrupted.
Inputs: [watcher :- (schema/protocol Watcher) shutdown-fn :- IFn stopped? :- (schema/atom schema/Bool)] Returns: Future Creates and returns a future. Processes events for the passed in watcher within the context of that future. The future will continue until the underlying WatchService is closed, or the future is interrupted.
(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