{"action":"opened","issue":{"url":"https://api.github.com/repos/marabunta/marabunta/issues/8","repository_url":"https://api.github.com/repos/marabunta/marabunta","labels_url":"https://api.github.com/repos/marabunta/marabunta/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/marabunta/marabunta/issues/8/comments","events_url":"https://api.github.com/repos/marabunta/marabunta/issues/8/events","html_url":"https://github.com/marabunta/marabunta/issues/8","id":377296696,"node_id":"MDU6SXNzdWUzNzcyOTY2OTY=","number":8,"title":"prototype for scheduler backend sql + redis","user":{"login":"nbari","id":364199,"node_id":"MDQ6VXNlcjM2NDE5OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/364199?v=4","gravatar_id":"","url":"https://api.github.com/users/nbari","html_url":"https://github.com/nbari","followers_url":"https://api.github.com/users/nbari/followers","following_url":"https://api.github.com/users/nbari/following{/other_user}","gists_url":"https://api.github.com/users/nbari/gists{/gist_id}","starred_url":"https://api.github.com/users/nbari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbari/subscriptions","organizations_url":"https://api.github.com/users/nbari/orgs","repos_url":"https://api.github.com/users/nbari/repos","events_url":"https://api.github.com/users/nbari/events{/privacy}","received_events_url":"https://api.github.com/users/nbari/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-05T08:34:18Z","updated_at":"2018-11-05T08:34:18Z","closed_at":null,"author_association":"MEMBER","body":"To scale and have persistence besides affecting running tasks, use as a backend  MySQL to store the defined tasks, and Redis (locally) to \"buffer\" task to be executed.\r\n\r\nDatabase then can be queried every 5 minutes and update tasks to be run from the query time + 10 minutes into redis, then a client (subscriber) could pull/listen to events hopefully achiving precision in the order of seconds.\r\n\r\nUse `cron` syntax/expression to define tasks & `every` option, for example:\r\n\r\n```\r\n{\r\n    \"name\" : \"task name\",\r\n    \"schedule\": {\r\n        \"minute\" : \"*\", \r\n        \"hour\" : \"*\",  \r\n        \"day_of_week\" : \"monday\",  \r\n        \"day_of_month\" : \"*/7\", # optional, defaults to *\r\n        \"month_of_year\" : \"[1-12]\", # optional, defaults to *\r\n    },\r\n    \"enabled\" : true,  # optional\r\n}\r\n```\r\n\r\nof using `every`:\r\n\r\n```\r\n{\r\n    \"name\" : \"task name\",\r\n    \"schedule\": {\r\n        \"every\" : \"30s\",  // every 30 seconds\r\n    },\r\n    \"enabled\" : true,  # optional\r\n}\r\n```"}}
{"actor":{"display_login":"nbari"}}