Skip to content

patrick-fitzgerald/actix-web-cron-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

actix-web-cron-example

About

A simple cron job example with a health check endpoint.

It uses actix_web and tokio_schedule.

Usage

Clone, build, and run

$ cargo run

Running `target/debug/actix-web-cron-example`
schedule_task event - 2022-09-22T21:41:36.001745-07:00
schedule_task event - 2022-09-22T21:41:37.002239-07:00
schedule_task event - 2022-09-22T21:41:38.001552-07:00
schedule_task event - 2022-09-22T21:41:39.000929-07:00
schedule_task event - 2022-09-22T21:41:40.001357-07:00

Health check endpoint:

curl http://127.0.0.1:8080/health

>> success

Dependencies

  • actix-web - a powerful, pragmatic, and extremely fast web framework for Rust
  • actix-rt - Tokio-based single-threaded async runtime for the Actix ecosystem
  • chrono - a Date and Time library for Rust
  • tokio_schedule - schedule tasks in tokio runtime

About

🦀 actix-web cron job example

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages