#[macro_use]
extern crate rust_embed;

extern crate job_scheduler;
use job_scheduler::{JobScheduler, Job};
use std::time::Duration;


#[derive(RustEmbed)]
#[folder = "public/"]
struct Asset;

fn main() {
    let mut sched = JobScheduler::new();

    let index_html = Asset::get("index.html").unwrap();
	println!("{:?}", std::str::from_utf8(index_html.as_ref()));

	for file in Asset::iter() {
		println!("{}", file.as_ref());
	}

    sched.add(Job::new("1/10 * * * * *".parse().unwrap(), || {
        println!("I get executed every 10 seconds!");
    }));

    loop {
        sched.tick();

        std::thread::sleep(Duration::from_millis(500));
    }
}
