Eclipse Public License 1.0

项目介绍

ane/vigil 是一个托管在 GitHub 上的开源项目,主要使用 Clojure 编写,采用 Eclipse Public License 1.0 许可证,目前获得 58 个 Star、0 次 Fork。

仓库全名
ane/vigil
开源许可证
Eclipse Public License 1.0
Star 数
58

README 摘要

Vigil creates Manifold streams from files. You place a watcher on a file and the stream produces content as new content is appended to the file. Vigil can be used to monitor logs asynchronously as a stream. If you are creating an event-driven system, it's easy to create an event filter with Vigil. Because the produced streams are Manifold streams, which act as a general-purpose compability layers for asynchronous…

完整内容见 GitHub 原始 README 或本页 。

常见问题

vigil 用什么语言开发?

主要使用 Clojure 编写,采用 Eclipse Public License 1.0 许可证,目前有 58 个 Star。

vigil 可以免费商用吗?

仓库标注的许可证为 Eclipse Public License 1.0,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 vigil 的源码?

可以直接克隆仓库:git clone https://github.com/ane/vigil.git,默认分支为 master;安装与运行步骤见仓库 README。

vigil 最近还在维护吗?

仓库最近一次更新为 2017年11月15日,当前没有未关闭的 Issue;Star 数为 58,可作为社区活跃度的参考。

关于

Turn files into asynchronous streams

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
61
价值分
35
活跃状态
活跃

README

Vigil Build Status Clojars Project EPL

Vigil creates Manifold streams from files. You place a watcher on a file and the stream produces content as new content is appended to the file.

[vigil "0.1.1"] ; add this to your project.clj

Vigil can be used to monitor logs asynchronously as a stream. If you are creating an event-driven system, it’s easy to create an event filter with Vigil.

Because the produced streams are Manifold streams, which act as a general-purpose compability layers for asynchronous communication, the file streams can be easily connected into other Clojure constructs, such as core.async, lazy sequences, promises, the list goes on.

For more information, see the documentation.

(require '[vigil.core :as v]
         '[manifold.stream :as s])

;; /foo/bar/baz contains "hello\nworld"
(def stream (v/watch-file "/foo/bar/baz"))

@(s/take! stream)
;; => ("hello" "world")

(spit "/foo/bar/baz" "blah\n" :append true)

;; the new line has now been pushed to the stream
@(s/take! stream)
;; => ("blah")

;; shut down the watcher
(s/close! stream)

Usage

The watcher can be stopped at any time by closing the stream. If you don’t want to receive the initial content, pass false to the initial parameter in watch-file. If you delete or truncate the file, the watcher will stop and the stream will be closed.

For more information, see the documentation.

License

Copyright © 2016 Antoine Kalmbach [email protected]

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

评论

暂无评论