Project

khronos

0.0
No commit activity in last 3 years
No release in over 3 years
Simple HTTP-based Job scheduling for the cloud.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6.4
~> 3.0.5

Runtime

~> 3.2.8
~> 0.10.0
~> 1.7.5
~> 1.6.7
~> 1.3.3
 Project Readme

khronos Build Status

Simple HTTP-based Job scheduling for the cloud.

Features

  • Schedule of HTTP Requests
  • Configure recurrency per request
  • Log HTTP status code for every request made
  • Query the database via REST API

Currently only PostgreSQL is supported. Patches for other databases are welcome.

How it works

Khronos use a rack app to schedule and query for scheduled tasks, and a worker process to execute them in the background.

At 'examples' directory you find two rackup files for these processes.

How to use

Create a scheduled task:

RestClient.post('http://localhost:3000/task', {
  :context => 'test',
  :at => 24.hours.from_now,
  :task_url => "http://myapp.com/do-something-awesome",
  :recurrency => 12.hours
})
# => {"active":true,"at":"2012-09-15T21:24:56-03:00","context":"test","id":1,"recurrency":1,"task_url":"http://myapp.com/do-something-awesome"}

Query for a scheduled task:

RestClient.get('http://localhost:3000/task', :params => { :context => 'test' })
# => {"active":true,"at":"2012-09-15T21:24:56-03:00","context":"test","id":1,"recurrency":1,"task_url":"http://myapp.com/do-something-awesome"}

Delete a scheduled task by query:

RestClient.delete('http://localhost:3000/task', :params => { :status_code => 404 })
# => {"deleted":3}
RestClient.delete('http://localhost:3000/task', :params => { :id => 9 })
# => {"deleted":1}

Query for logs for tasks that already ran.

RestClient.get('http://localhost:3000/schedule/logs', :params => { :status_code => 500 })
# => [{"id":3,"schedule_id":1,"started_at":"2012-09-15T13:38:48-03:00","status_code":500},{"id":5,"schedule_id":2,"started_at":"2012-09-15T13:38:48-03:00","status_code":500}]

Note: these examples are using rest-client and activesupport.

Contributing

Feel free to fork and send pull requests with features and/or bug fixes.

License

Khronos is released under the MIT license. Please read the LICENSE file.