Code Monkey home page Code Monkey logo

econfd's Introduction

econfd - An erlang conf.d Build Status

This erlang library enables to check/monitor if some files/resources changed over time and notify some handler module about that:

  • Watch local file system files (notify when modified ts changes)
  • Watch http endpoint (notify when content MD5 changes)
  • Watch S3 object (notify when S3 last-modified changes)

The handlers can be setup by configuration (app.config) or programmatically

Installation

Add the dependency to you rebar.config

{deps, [
    ...
    {econfd,     ".*", {git, "git://github.com/posilva/econfd.git",                         {branch, "master"   }}},
    ...
]}.

Usage

Configure using app.config:

 {econfd, [
        {handlers, [
            %%{HandlerName (UNIQUE), file | http | s3, CallbackModule, [{interval_ms, 10000}, {init_delay, 5000}, {Specific, Options}]},
            {file_example_name, file, file_example_handler, [
                {interval_ms, 10000},
                {init_delay, 5000},
                {file_path, "FILE_PATH"}
            ]},
            {http_example_name, http, http_example_handler, [
                {interval_ms, 5000},
                {url, "URL_HTTP_TO_GET"}
            ]},
            {s3_example_name, s3, s3_example_handler, [
                {interval_ms, 5000},
                {s3_bucket, "S3_BUCKET_NAME"},
                {s3_key, "S3_OBJECT_KEY"},
                {aws_secret_key, "AWS_SECRET_KEY"},
                {aws_access_key, "AWS_ACCESS_KEY"}
            ]}
        ]}
    ]}

Or, programmatically:

add_watcher(dynamic_example_name, 
            file, 
            dynamic_example_handler, 
            [{interval_ms, 10000},
            {init_delay, 5000},
            {file_path, "FILE_PATH"}]).

Contributing

The usual thing!

econfd's People

Contributors

posilva avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.