Giter VIP home page Giter VIP logo

fnq's Introduction

fnq (pronounced FUNK)

Single CLI for a flock-based approach to queuing Unix tasks & processes


build workflow

Usage

Set FNQ_DIR in your env to dictate where to store queue files. Defaults to $(pwd)

$ fnq [--quiet | --clean] cmd

Protip: since fnq uses FNQ_DIR to determine queue state, you can create an entirely new queue by changing FNQ_DIR

Example

$ export FNQ_DIR=~/.fnqdir # Can put in .bashrc for global use
$ fnq ./task1 # Can also look in PATH
fnq1617220638670.52957
$ fnq ./task2 taskarg1 taskarg2 # Queues future tasks
fnq1617221011799.53621
$ fnq -q ./task3
$ ls $FNQ_DIR
fnq1617220638670.52957  fnq1617221011799.53621  fnq1617221184552.54371
$ fnq --tap fnq1617221011799.53621 # Will check if task is running
$ fnq --block # Will block until last task finishes

Flags

--quiet / -q

No stdout

Note: std{out,error} from the task cmd will still be saved to the corresponding queue file

--clean / -c

Deletes queue file in $FNQ_DIR after task completes

--block / -b <queuefile.pid>

Accepts a queue output file to wait for, otherwise waits/blocks for entire queue to finish

--tap / -t <queuefile.pid>

Accepts a queue output file to determine if running, otherwise determines success based if entire queue if finished

--watch / -w <queuefile.pid>

Similar to --block but will print to stdout contents of the currently running queue files

Install

Cargo

If you're using a recent version of Cargo, you can see the cargo install command:

$ cargo install fnq

Build from source

After git cloning this repo, you can install as a cargo crate through

$ cargo install --path path/to/repo

This should make fnq available everywhere assuming your cargo crates are in $PATH

About

Much of the functionality here is heavily inspired by nq (written in C).

This package depends on nix to abstract over Unix flock operations, so presumably if nix works on a platform, this bin should work. Part of the work needed here is creating a suitable testing suite to run across different machines

Currently tested on linux x86_64 during development

License

MIT - Maintained by Milan

fnq's People

Contributors

mdaverde avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

fnq's Issues

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.