https://github.com/lomin/component-restart
A simple watcher that restarts components when files change.
https://github.com/lomin/component-restart
clojure component
Last synced: 9 months ago
JSON representation
A simple watcher that restarts components when files change.
- Host: GitHub
- URL: https://github.com/lomin/component-restart
- Owner: lomin
- License: epl-1.0
- Created: 2015-04-14T20:08:25.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-06-14T08:54:14.000Z (over 8 years ago)
- Last Synced: 2025-03-28T21:21:50.893Z (10 months ago)
- Topics: clojure, component
- Language: Clojure
- Homepage:
- Size: 9.77 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# component-restart
Provides a single function that watches for changes in source files in all directories on the classpath. When a change has been detected, it reloads the modifed source files and restarts the component-system.
## Leiningen
*component-restart* is available from Clojars. Add the following dependency to your *project.clj*:
[](http://clojars.org/me.lomin/component-restart)
## Usage ##
Call the watch function with two parameters: the var pointing to the function to restart and the started system.
```clojure
(require '[me.lomin.component-restart :as restart])
(defn -main []
(let [system (component/start (make-system))]
(restart/watch (var -main) system)))
```
## License ##
Copyright © 2015 Steven Collins. All rights reserved. The use and
distribution terms for this software are covered by the Eclipse
Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
which can be found in the file LICENSE at the root of this
distribution. By using this software in any fashion, you are
agreeing to be bound by the terms of this license. You must
not remove this notice, or any other, from this software.