Giter Club home page Giter Club logo

switchboard's Issues

feature request: Support for specific event types

As a user, I want to be able to configure and watch for specific event types. For example, I should have the ability to watch for CREATE events specifically that match a file extension/pattern, or DELETE events as example.

Switchboard launch checklist

  • Add COC readme
  • Add Contributing guidelines
  • Add more examples
  • Launch website
  • Add E2E tests for 3 os arches + have them green
  • Update video on homepage and site

Upgrade fsnotify version

The latest version of fsnotify is 1.7.0 yet switchboard is a custom version on github.com/Cian911/fsnotify v1.5.2-0.20220220230351-4d6a6a3b3090.

We should update to the latest version in our custom fork to reap the benefits of recent updates. This should be replicated to pro as well.

feature request: Add priority order to watchers

Each watcher should have a changeable priority which would denote which watcher should process an event in the case that multiple watchers match the same event. Take the example below.

I have the following config for switchboard:

pollingInterval: 10
watchers:
  - path: "/home/cian/Downloads"
    destination: "/home/cian/Documents"
    ext: ".txt"
  - path: "/home/cian/Downloads"
    destination: "/home/cian/Documents/Reports"
    ext: ".txt"
    pattern: "(?i)(financial-report-[a-z]+-[0-9]+.txt)"
  - path: "/home/cian/Downloads"
    destination: "/home/cian/Videos"
    ext: ".mp4"

In the event that I save a txt file that matches the first two watchers, we encounter a race condition between the two as to which will process the event first.

I propose adding a priority attribute to switchboard which will denote the order in which events should be processed by watchers, should multiple watchers be capable of matching the same event. A new config might look like this:

pollingInterval: 10
watchers:
  - path: "/home/cian/Downloads"
    destination: "/home/cian/Documents"
    ext: ".txt"
    priority: 1
  - path: "/home/cian/Downloads"
    destination: "/home/cian/Documents/Reports"
    ext: ".txt"
    pattern: "(?i)(financial-report-[a-z]+-[0-9]+.txt)"
    priority: 2

1 in this case should be the lowest priority, which all watcher will default to, and a higher priority ascending from that 2, 3, 4...

feature request: Add conditional logging

Add support for conditional logging - User should be able to choose the log level they want for switchboard via a flag passed to the watch command.

As example:

switchboard watch --config -log verbose

Loging should be disabled by default otherwise - this remove all the noise when being run.

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.