Skip to content

sukuizhang/resource-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

resource-monitor

monitor file resource change

Usage
1.add dependency [resource-monitor "0.0.1"] to your project.clj.

2.add (:require [resource-monitor.core :as monitor]) to your unit.

3.write your function to response to the resource change.
   in these version, we has three type response functions.
:visit-file 
    your function like (f file-name).
           file-name is the file name of modified file.
:visit-all
    your function like (f resource file-content)
           resource contains monitor file and your listeners messages.
           file-content is content of monitor file.

:visit-line
    your function like (f resource line)
          resource like preview.
          line is a line of file content.

  As you know, :visit-file and :visit-all functions will be invoke once when file resource changed, and :visit-line will be invoke line by line.

4.install your monitor.
  invoke (monitor/monitor resource-name resource-file-name your-listeners)
         resource-name: resource name, must be unique.
         resource-file-name: be monitor file name.
         listeners: a map contains pair of listener type and listeners vector, listener type is descript preview, :visite-file,:visite-all and :visit-line is now support.

About

do file resource change monitor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published