Minor update to interval publishing to allow for more accurate status publishing intervals.
- Added an optional delay parameter to the publish_status method, allowing for a specified delay at the start of the interval, rather than forcing all delay to the end.
- This delay parameter must be a float and cannot be greater than the interval parameter.
- Any delay at the start of the loop will be subtracted from the total interval delay at the end. For example, an interval of 10 seconds with a 2 second delay will delay 2 seconds before generating the publish data, and will then delay the additional 8 seconds after publishing.
- Reworked the interval timing to ensure accurate intervals, even if generating the publish data takes some time.
- Now, before generating the data, rmqtools gets the current time. It then gets the time after publishing and subtracts the total time taken to publish from the ending delay interval.
- This ensures that if the delay parameter is set to 10 seconds, the publisher will publish every 10 seconds, rather than adding 10 seconds to the total data generation time.
- Both of these changes allow for greater flexibility when implementing publish sequences, ensuring that sequence order is maintained through accurate timing.