Skip to content
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

Extend duration documentation #162

Open
thomas-nicolai-frequenz opened this issue Apr 29, 2024 · 4 comments
Open

Extend duration documentation #162

thomas-nicolai-frequenz opened this issue Apr 29, 2024 · 4 comments
Labels
part:protobuf Affects the protocol buffer definition files priority:high Address this as soon as possible type:enhancement New feature or enhancement visitble to users

Comments

@thomas-nicolai-frequenz
Copy link

thomas-nicolai-frequenz commented Apr 29, 2024

What's needed?

We need to improve the documentation for the duration parameter as shown below:

Proposed solution

message Dispatch {
  // ...

-  // Duration in seconds
+  // Duration of the dispatch in seconds. 
+  //
+  // !!! note
+  //     This field manages how long the dispatch lasts:
+  //     - `null` value indicates an infinite duration, meaning the dispatch continues indefinitely.
+  //     - A value of `0` indicates a one-time execution, which does not repeat or persist.
+  //     - Positive values specify the duration in seconds for which the dispatch should be active.
+  //
+  //     Example of how to set duration
+  //         duration_seconds: { value: 3600 } // Duration of 1 hour
+  //         duration_seconds: null // Infinite duration
+  //         duration_seconds: { value: 0 } // One-time execution
- //  uint32 duration = 7;
+ //  optional uint32 duration_seconds = 7;
}

Use cases

No response

Alternatives and workarounds

No response

Additional context

No response

@thomas-nicolai-frequenz thomas-nicolai-frequenz added part:❓ We need to figure out which part is affected priority:❓ We need to figure out how soon this should be addressed type:enhancement New feature or enhancement visitble to users priority:high Address this as soon as possible part:protobuf Affects the protocol buffer definition files and removed part:❓ We need to figure out which part is affected priority:❓ We need to figure out how soon this should be addressed labels Apr 29, 2024
@llucax
Copy link
Contributor

llucax commented Apr 30, 2024

Maybe it would be also worth clarifying that this is a duration within one run if it is a recurring dispatch. It is not related to the recurrence itself.

@thomas-nicolai-frequenz
Copy link
Author

thomas-nicolai-frequenz commented Apr 30, 2024

@leandro-lucarella-frequenz how about?

message Dispatch {
  // ...

-  // Duration in seconds
+  // Duration of the dispatch in seconds. 
+  //
+  // The duration specifies how long each occurrence of the dispatch lasts during 
+  // a single run, applies only to the individual instance and not the overall cycle of 
+  // recurring dispatches. This setting is independent of the recurrence pattern, 
+  // which is governed by separate recurrence settings.
+  // 
+  // !!! note
+  //     This field manages how long each occurrence of the dispatch lasts:
+  //     - `null` value indicates an infinite duration, meaning each dispatch occurrence 
+  //.      continues indefinitely.
+  //     - A value of `0` indicates a one-time execution for that particular occurrence, 
+  //       which does not repeat or persist beyond its initial run.
+  //     - Positive values specify the duration in seconds for each dispatch occurrence 
+  //       should be active.
+  //
+  //     Example of how to set duration
+  //         duration_seconds: { value: 3600 } // Duration of 1 hour
+  //         duration_seconds: null // Infinite duration
+  //         duration_seconds: { value: 0 } // One-time execution    
+  //
- //    uint32 duration = 7;
+ //  optional uint32 duration_seconds = 7;
}

The duration parameter is renamed to duration_seconds so its more distinct from the recurrence pattern settings, ensuring that there's less confusion between the duration of individual runs and the overall scheduling pattern. Moreover, at the top it explicitly states that the duration_seconds applies to each individual occurrence of the dispatch.

@leandro-lucarella-frequenz

I'd remove the "Maybe it would be also worth clarifying that " ;)

@thomas-nicolai-frequenz
Copy link
Author

Oh, sorry I've improved the above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part:protobuf Affects the protocol buffer definition files priority:high Address this as soon as possible type:enhancement New feature or enhancement visitble to users
Projects
None yet
Development

No branches or pull requests

3 participants