{"id":17330602,"url":"https://github.com/adam12/scheduled","last_synced_at":"2025-04-14T17:54:18.239Z","repository":{"id":56894411,"uuid":"94925813","full_name":"adam12/scheduled","owner":"adam12","description":"A very lightweight clock process with minimal dependencies and no magic","archived":false,"fork":false,"pushed_at":"2023-09-08T01:42:18.000Z","size":29,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T05:43:28.508Z","etag":null,"topics":["lesscode","padrino","roda","sinatra"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adam12.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-20T19:05:33.000Z","updated_at":"2024-04-15T20:25:17.000Z","dependencies_parsed_at":"2022-08-21T01:20:34.155Z","dependency_job_id":null,"html_url":"https://github.com/adam12/scheduled","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adam12%2Fscheduled","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adam12%2Fscheduled/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adam12%2Fscheduled/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adam12%2Fscheduled/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adam12","download_url":"https://codeload.github.com/adam12/scheduled/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650427,"owners_count":21139671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lesscode","padrino","roda","sinatra"],"created_at":"2024-10-15T14:51:45.191Z","updated_at":"2025-04-14T17:54:18.201Z","avatar_url":"https://github.com/adam12.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scheduled\n\nA simple task scheduler, akin to ClockWork or Rufus Scheduler.\n\n## Project Goals\n\n* Absolutely no dependency on ActiveSupport\n* Very small dependency tree\n* Framework agnostic\n* No built-in daemonization\n* No scheduling DSL\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"scheduled\"\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install scheduled\n\n## Usage\n\n### Defining tasks\n\nTasks are defined by calling `Scheduled.every` with an interval and a block to execute.\nThe interval can be a basic Integer to represent seconds, or a callable object that receives\nthe current Job.\n\nIf the callable object returns a truthy value, the block is executed.\n\n```ruby\nrequire \"scheduled\"\n\n# Called every 60 seconds\nScheduled.every(60) { do_work } # Perform some job\n\n# Using a cronline\nScheduled.every(\"* * * * *\") { do_work }\n\ntwo_hours_from_last_run = -\u003e(job) do\n  Time.now - job.last_run \u003e= 60*60*2\nend\nScheduled.every(two_hours_from_last_run) { puts \"Updating\" }\n\n# Run the scheduler\nScheduled.wait\n```\n\n### Running the scheduler\n\nProvided your schedule file ends with a call to `Scheduled.wait`, just run it\nas any other Ruby script.\n\n    ruby schedule.rb\n\n### Quick Returning Tasks\n\nScheduled works best if you schedule the tasks into a long-running queue, such as\nBackburner or Sidekiq.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/adam12/scheduled.\n\nI love pull requests! If you fork this project and modify it, please ping me to see\nif your changes can be incorporated back into this project.\n\nThat said, if your feature idea is nontrivial, you should probably open an issue to\n[discuss it](http://www.igvita.com/2011/12/19/dont-push-your-pull-requests/)\nbefore attempting a pull request.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadam12%2Fscheduled","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadam12%2Fscheduled","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadam12%2Fscheduled/lists"}