Git Product home page Git Product logo

Comments (7)

paulo-ferraz-oliveira avatar paulo-ferraz-oliveira commented on June 23, 2024

What about syntax?

How does this look?

{"make test", [{timeout, 5000}]} % in case you want more options in the future

or simpler still

{"make test", 5000} % you could still add more options with a new syntax and "deprecate this one"

from rebar_cmd.

gootik avatar gootik commented on June 23, 2024

looks good but lets support default configs too:

{commands, [
 {a, "make test", [configs...]},
 {b, "make run"}
]}.

from rebar_cmd.

paulo-ferraz-oliveira avatar paulo-ferraz-oliveira commented on June 23, 2024

You mean not using an option list? Sure, I was not mentioning otherwise (I was giving examples for the "extra" interface - since I don't want to break existing implementations/usage.

from rebar_cmd.

gootik avatar gootik commented on June 23, 2024

sorry I meant we should support both of the cases in my example. where [configs..] is your suggestion. So my revised example of things that should be supported:

{commands, [
 {a, "make test", [
    {timeout, 5000}, 
    {ignore_output, true} % just an example, not suggesting we should do this
 ]},
 {b, "make run"}
]}.

from rebar_cmd.

paulo-ferraz-oliveira avatar paulo-ferraz-oliveira commented on June 23, 2024

Communication 😄

When I wrote You mean not using an option list? I should've written Do you mean "not using an option list at every declaration" (and using a default list of options, otherwise) when you state "lets support default configs too"?

I got it, though. I wouldn't force a list if I didn't have too, anyway.

from rebar_cmd.

gootik avatar gootik commented on June 23, 2024

Hahaha. Sounds good

from rebar_cmd.

paulo-ferraz-oliveira avatar paulo-ferraz-oliveira commented on June 23, 2024

I've started fiddling with the implementation, for this issue, but have some questions.

What does the notion of "timeout" mean here, exactly? I don't think we can easily "stop command execution" on the OS once it's been started by os:cmd. I maybe missing something, though.

It would be OK, for example, if you "chain" commands.

e.g.

{slow_cmd, [
    {"find / -name .gitignore ", [{timeout, 2000}]},
    "ls"
]}.

Here, timeout could prevent the execution of ls.

And another thing, would you still consider the command result for output even if it arrived late? Or just ignore it?

from rebar_cmd.

Related Issues (14)

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.