-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new flux command sleep #495 #559
Conversation
@fsteeg could you have a look, if this would be way worth to continue |
Basic idea looks good. Some issues:
|
Thanks I adjusted as suggested. |
Would it make sense to enable this command to also support the Fix function use case? Just add another setter for the time unit and extract the sleep "action" into a dedicated method. Then we could easily reuse this class to implement the corresponding Fix function (see Catmandu). |
I think this is a good idea, could you provide the code for this? |
…etafacture-fix). (#559)
…559) See also https://metacpan.org/pod/Catmandu::Fix::sleep (defaults to `SECONDS`, doesn't support `NANOSECONDS` and `DAYS`).
@fsteeg can you review the additions that @blackwinter introduced. Also can you tell me how I would write a unit test for this? Not sure since it does change the result in a transformation. |
Initially, I thought we should just skip the test for this. But since you brought it up: You could verify that the process takes at least the amount of time that it was configured to sleep. It's not pretty, but it's something.
You mean "it does not change the result", right? |
Okay, I will have a look at this.
Correct, it does not change the result |
@blackwinter is this the kind of test you had in mind? |
Yes, thanks. However, I've modified your test a little (74bc15d). Stylistic changes:
Functional changes:
|
Resolves #495