croner-rust

Rust flavor of the popular cron scheduler croner.

MIT License

Downloads
51.1K
Stars
27

Bot releases are hidden (Show)

croner-rust - v2.0.4 Latest Release

Published by Hexagon 10 months ago

Changes

This release contains a minor update, exposing the errors module to the public interface.

Full Changelog: https://github.com/Hexagon/croner-rust/compare/v2.0.3...v2.0.4

croner-rust - v2.0.3

Published by Hexagon 10 months ago

Changes

Maintenance release focusing mainly on documentation updates and additional test cases.

Full Changelog: https://github.com/Hexagon/croner-rust/compare/v2.0.2...v2.0.3

croner-rust - v2.0.2

Published by Hexagon 10 months ago

Changes

  • Added support for Quartz-style last occurrence of weekday '5L'
  • Added tests ensuring that both 5#L and 5L works, and are only allowed in the day-of-week part
  • Code cleanup
  • Documentation improvements

Full Changelog: https://github.com/Hexagon/croner-rust/compare/v2.0.1...v2.0.2

croner-rust - v2.0.1

Published by Hexagon 10 months ago

Changes

  • Fixed an issue related to impossible patterns. To prevent infinite loops, the search for future occurrences is now limited to the year 5000. Attempts to find times beyond this limit will result in CronError::TimeSearchLimitExceeded.

Full Changelog: https://github.com/Hexagon/croner-rust/compare/v2.0.0...v2.0.1

croner-rust - v2.0.0

Published by Hexagon 10 months ago

Croner 2.0 introduces key changes, notably the default disabling of second granularity and added opt-in support for Quartz-style handling of weekday numbers.

New Features

  • Introduction of .with_seconds_required and .with_seconds_optional: Now you can specify if second-level precision in your cron patterns should be disabled (default), optional or required.
  • .with_alternative_weekdays: This feature allows the configuration of alternative weekday handling (e.g. Quartz compatibility).

Improvements

  • Seconds Disabled by Default: Second-level precision is now an opt-in feature, aligning the defaults with POSIX/system cron.
  • Enhanced Testing: More cases covered with tests.
  • Documentation Updates: Documentation is both fixed and updated.

Fixes

  • Timezone Handling Enhancement: Improved timezone handling for more accurate scheduling.
  • CronPattern Chaining: Resolved an issue related to the chaining mechanism of CronPattern.

Full Changelog: https://github.com/Hexagon/croner-rust/compare/v1.0.5...v2.0.0

croner-rust - v1.0.5

Published by Hexagon 10 months ago

Changes

  • Improves internal documentation
  • Removes unused code

Full Changelog: https://github.com/Hexagon/croner-rust/compare/v1.0.4...v1.0.5

croner-rust - v1.0.4

Published by Hexagon 11 months ago

Changes

  • Adds .with_dom_and_dow(bool): New method which allow you to modify how the day of the month and day of the week values are combined.
  • Adds additional tests to improve reliability and cover new features.

Full Changelog: https://github.com/Hexagon/croner-rust/compare/v1.0.3...v1.0.4

croner-rust - v1.0.3

Published by Hexagon 11 months ago

Changes

  • Fixes problem with matching closest weekday

Full Changelog: https://github.com/Hexagon/croner-rust/compare/v1.0.0...v1.0.3

croner-rust - v1.0.2

Published by Hexagon 11 months ago

croner-rust - v1.0.0

Published by Hexagon 11 months ago

Release Notes for Croner (Rust) - Version 1.0.0

Initial Stable Release

Introducing crate croner version 1.0.0 - a fully featured, lightweight and efficient Rust library for parsing and evaluating cron patterns.

Key Features:

  • Parse and evaluate cron expressions.
  • Extends Vixie-cron patterns with L, #, W and optional second granularity.
  • Time zone support (chrono and chrono-tz compatible).
  • Robust error handling.
  • Nickname patterns: @yearly, @monthly, @weekly, @daily, @hourly.
  • Iterators for easy iteration over upcoming occurrences.
  • Built with performance and simplicity in mind.
  • MIT Licensed.

Usage Example showcasing is_time_matching, find_next_occurrence and iter_from:

use croner::Cron;
use chrono::Local;

// Example: Parse cron expression
let cron: Cron = "0 18 * * * FRI".parse().expect("Couldn't parse cron string");

// Example: Compare cron pattern with current local time
let time = Local::now();
let matches = cron.is_time_matching(&time).unwrap();

// Example: Get next match
let next = cron.find_next_occurrence(&time, false).unwrap();

// Output results
println!("Current time is: {}", time);
println!("Pattern \"{}\" does {} time {}", cron.pattern.to_string(), if matches { "match" } else { "not match" }, time );
println!("Pattern \"{}\" will match next time at {}", cron.pattern.to_string(), next);

// Example: Iterator
println!("Next 5 matches:");
for time in cron.clone().iter_from(Local::now()).take(5) {
    println!("{}", time);
}

For detailed usage and API documentation, visit Croner on docs.rs and check out the README.

croner-rust - v0.0.10

Published by Hexagon 11 months ago

Changes

  • scheduler.tick() now returns a SchedulerResult (::Dead,::NoOp,::TaskTriggered or ::ThreadPoolExhausted) instead of bool
  • Code cleanup

Full Changelog: https://github.com/Hexagon/croner-rust/compare/v0.0.9...v0.0.10

croner-rust - v0.0.9

Published by Hexagon 11 months ago

Changes

  • Add custom thread pool

Full Changelog: https://github.com/Hexagon/croner-rust/compare/v0.0.8...v0.0.9

croner-rust - v0.0.8

Published by Hexagon 11 months ago

Changes

  • Cleanup, fixes and better use of thread pool

Full Changelog: https://github.com/Hexagon/croner-rust/compare/0.0.7...v0.0.8

croner-rust - v0.0.7

Published by Hexagon 11 months ago

Changes

  • Add closest weekday W feature
  • Add threaded scheduler

Full Changelog: https://github.com/Hexagon/croner-rust/compare/v0.0.6...0.0.7

croner-rust - v0.0.6

Published by Hexagon 11 months ago

Changes

  • Huge performance improvements

Full Changelog: https://github.com/Hexagon/croner-rust/compare/v0.0.5...v0.0.6

croner-rust - v0.0.5

Published by Hexagon 11 months ago

Changes

  • Documentation improvements
  • Memory handling improvements
  • Reduces complexity of is_time_matching and find_next_occurrence
  • Code cleanup (clippy linting)

Full Changelog: https://github.com/Hexagon/croner-rust/compare/v0.0.4...v0.0.5

croner-rust - v0.0.4

Published by Hexagon 12 months ago

Changes

  • Code refactor
  • More tests
  • Add iterator function iter_from and iter_after
  • Add inline documentation with examples

Full Changelog: https://github.com/Hexagon/croner-rust/compare/v0.0.3...v0.0.4

croner-rust - v0.0.3

Published by Hexagon 12 months ago

Changes

  • Refactored code
  • Add nth weekday (5#2 and 5#L).
  • Add last day of month L.
  • Add internal option dom_and_dow defaulting to false.

Full Changelog: https://github.com/Hexagon/croner-rust/compare/v0.0.2...v0.0.3

croner-rust - v0.0.2

Published by Hexagon 12 months ago

Initial automated release