Title: JobQueue: Simpler API for adding jobs by jh0ker · Pull Request #484 · python-telegram-bot/python-telegram-bot · GitHub
Open Graph Title: JobQueue: Simpler API for adding jobs by jh0ker · Pull Request #484 · python-telegram-bot/python-telegram-bot
X Title: JobQueue: Simpler API for adding jobs by jh0ker · Pull Request #484 · python-telegram-bot/python-telegram-bot
Description: A version of #482 with less bullshit.
New API for adding jobs
Noam (and I) thought of a new, simpler API for the JobQueue to add new jobs, with the goal to replace the current paradigm of creating Job instances and using JobQueue.put to add them to the job queue. For now, there are three new methods in the JobQueue class:
JobQueue.run_once(self, callback, when, context=None, name=None)
JobQueue.run_repeating(self, callback, interval, first=None, context=None, name=None)
JobQueue.run_daily(self, callback, time, days=Days.EVERY_DAY, context=None, name=None)
Each of them creates a Job instance and uses the JobQueue.put method internally, but they hide the unimportant things from the user. The new Job is also returned from the method.
>>> from datetime import datetime, time, timedelta
>>> job_queue.run_once(new_year_callback, datetime(2017, 1, 1))
Open Graph Description: A version of #482 with less bullshit. New API for adding jobs Noam (and I) thought of a new, simpler API for the JobQueue to add new jobs, with the goal to replace the current paradigm of creating ...
X Description: A version of #482 with less bullshit. New API for adding jobs Noam (and I) thought of a new, simpler API for the JobQueue to add new jobs, with the goal to replace the current paradigm of creating ...
Opengraph URL: https://github.com/python-telegram-bot/python-telegram-bot/pull/484
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:42aa3620-32da-deb3-ac15-18c32a57723c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C24A:16F405:2CFF8F8:3A9C81F:6A5CC94A |
| html-safe-nonce | 191f1359c59210439c5958d1ab96fecd7675693e8c02f98cc8ce3e9c9647f4b3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjRBOjE2RjQwNToyQ0ZGOEY4OjNBOUM4MUY6NkE1Q0M5NEEiLCJ2aXNpdG9yX2lkIjoiMzgzODY1OTAxNTc5NTg1MzY0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c6e7a757ad892d2f85b580ee22f047a5e95651bdb3cceee2d2a860feb5253538 |
| hovercard-subject-tag | pull_request:97996135 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python-telegram-bot/python-telegram-bot/pull/484/files |
| twitter:image | https://avatars.githubusercontent.com/u/3945220?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/3945220?s=400&v=4 |
| og:image:alt | A version of #482 with less bullshit. New API for adding jobs Noam (and I) thought of a new, simpler API for the JobQueue to add new jobs, with the goal to replace the current paradigm of creating ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python-telegram-bot/python-telegram-bot git https://github.com/python-telegram-bot/python-telegram-bot.git |
| octolytics-dimension-user_id | 16178365 |
| octolytics-dimension-user_login | python-telegram-bot |
| octolytics-dimension-repository_id | 38696925 |
| octolytics-dimension-repository_nwo | python-telegram-bot/python-telegram-bot |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 38696925 |
| octolytics-dimension-repository_network_root_nwo | python-telegram-bot/python-telegram-bot |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width