René's URL Explorer Experiment


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)) >>> job_queue.run_repeating(update_channel_callback, timedelta(minutes=10), first=datetime.now()) >>> job_queue.run_daily(alarm_clock_callback, time(8, 30)) The "old" way of using Job instances and JobQueue.put yourself still works and should be 100% backwards compatible. JobQueue.put The JobQueue.put method has been extended to accept absolute times as datetime.datetime and datetime.time. >>> from datetime import datetime, time, timedelta >>> job_queue.put(happy_new_year_job, next_t=datetime(2017, 1, 1)) >>> job_queue.put(alarm_clock_job, next_t=time(8, 30)) >>> midnight_job = Job(midnight_callback, timedelta(days=1)) >>> job_queue.put(midnight_job, next_t=time(0, 0)) If you pass a datetime.time object for next_t and it's already later than the specified time (eg it's 10:00 and next_t is time(8, 30)), the job will execute the next day. I made the interval parameter for Job optional, so you can just leave it for non-repeating jobs (however, you must explicitly pass repeat=False)

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

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:42aa3620-32da-deb3-ac15-18c32a57723c
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC24A:16F405:2CFF8F8:3A9C81F:6A5CC94A
html-safe-nonce191f1359c59210439c5958d1ab96fecd7675693e8c02f98cc8ce3e9c9647f4b3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjRBOjE2RjQwNToyQ0ZGOEY4OjNBOUM4MUY6NkE1Q0M5NEEiLCJ2aXNpdG9yX2lkIjoiMzgzODY1OTAxNTc5NTg1MzY0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc6e7a757ad892d2f85b580ee22f047a5e95651bdb3cceee2d2a860feb5253538
hovercard-subject-tagpull_request:97996135
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python-telegram-bot/python-telegram-bot/pull/484/files
twitter:imagehttps://avatars.githubusercontent.com/u/3945220?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/3945220?s=400&v=4
og:image:altA 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_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python-telegram-bot/python-telegram-bot git https://github.com/python-telegram-bot/python-telegram-bot.git
octolytics-dimension-user_id16178365
octolytics-dimension-user_loginpython-telegram-bot
octolytics-dimension-repository_id38696925
octolytics-dimension-repository_nwopython-telegram-bot/python-telegram-bot
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id38696925
octolytics-dimension-repository_network_root_nwopython-telegram-bot/python-telegram-bot
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9c975978430e9ad293956f2bbdaf153b1bd84a99
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python-telegram-bot/python-telegram-bot/pull/484/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-telegram-bot%2Fpython-telegram-bot%2Fpull%2F484%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-telegram-bot%2Fpython-telegram-bot%2Fpull%2F484%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python-telegram-bot%2Fpython-telegram-bot
Reloadhttps://github.com/python-telegram-bot/python-telegram-bot/pull/484/files
Reloadhttps://github.com/python-telegram-bot/python-telegram-bot/pull/484/files
Reloadhttps://github.com/python-telegram-bot/python-telegram-bot/pull/484/files
Please reload this pagehttps://github.com/python-telegram-bot/python-telegram-bot/pull/484/files
python-telegram-bot https://github.com/python-telegram-bot
python-telegram-bothttps://github.com/python-telegram-bot/python-telegram-bot
Notifications https://github.com/login?return_to=%2Fpython-telegram-bot%2Fpython-telegram-bot
Fork 6.1k https://github.com/login?return_to=%2Fpython-telegram-bot%2Fpython-telegram-bot
Star 29.3k https://github.com/login?return_to=%2Fpython-telegram-bot%2Fpython-telegram-bot
Code https://github.com/python-telegram-bot/python-telegram-bot
Issues 24 https://github.com/python-telegram-bot/python-telegram-bot/issues
Pull requests 9 https://github.com/python-telegram-bot/python-telegram-bot/pulls
Discussions https://github.com/python-telegram-bot/python-telegram-bot/discussions
Actions https://github.com/python-telegram-bot/python-telegram-bot/actions
Projects https://github.com/python-telegram-bot/python-telegram-bot/projects
Wiki https://github.com/python-telegram-bot/python-telegram-bot/wiki
Security and quality 0 https://github.com/python-telegram-bot/python-telegram-bot/security
Insights https://github.com/python-telegram-bot/python-telegram-bot/pulse
Code https://github.com/python-telegram-bot/python-telegram-bot
Issues https://github.com/python-telegram-bot/python-telegram-bot/issues
Pull requests https://github.com/python-telegram-bot/python-telegram-bot/pulls
Discussions https://github.com/python-telegram-bot/python-telegram-bot/discussions
Actions https://github.com/python-telegram-bot/python-telegram-bot/actions
Projects https://github.com/python-telegram-bot/python-telegram-bot/projects
Wiki https://github.com/python-telegram-bot/python-telegram-bot/wiki
Security and quality https://github.com/python-telegram-bot/python-telegram-bot/security
Insights https://github.com/python-telegram-bot/python-telegram-bot/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython-telegram-bot%2Fpython-telegram-bot%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython-telegram-bot%2Fpython-telegram-bot%2Fissues%2Fnew%2Fchoose
tsnoamhttps://github.com/tsnoam
masterhttps://github.com/python-telegram-bot/python-telegram-bot/tree/master
jobqueue-absolute-simplehttps://github.com/python-telegram-bot/python-telegram-bot/tree/jobqueue-absolute-simple
Conversation 0 https://github.com/python-telegram-bot/python-telegram-bot/pull/484
Commits 9 https://github.com/python-telegram-bot/python-telegram-bot/pull/484/commits
Checks 0 https://github.com/python-telegram-bot/python-telegram-bot/pull/484/checks
Files changed https://github.com/python-telegram-bot/python-telegram-bot/pull/484/files
Please reload this pagehttps://github.com/python-telegram-bot/python-telegram-bot/pull/484/files
JobQueue: Simpler API for adding jobs https://github.com/python-telegram-bot/python-telegram-bot/pull/484/files#top
Show all changes 9 commits https://github.com/python-telegram-bot/python-telegram-bot/pull/484/files
8ead72e jobqueue: add support for specifying next_t in datetime.datetime or d… jh0ker Dec 13, 2016 https://github.com/python-telegram-bot/python-telegram-bot/pull/484/commits/8ead72e3ef8414a06bca3666d44cb69a725d09a2
c7cd379 jobqueue.py: move the check for job.interval types into Job.__init__ jh0ker Dec 14, 2016 https://github.com/python-telegram-bot/python-telegram-bot/pull/484/commits/c7cd3790168d26cae5fc6df61aa3f35d122b655c
09ddc1b DAAAANGER ZOOOONE jh0ker Dec 14, 2016 https://github.com/python-telegram-bot/python-telegram-bot/pull/484/commits/09ddc1b1a8c00e47cc095e64ba4f4c09f7c8df11
d5ce32c removed Job.run_immediately and related code jh0ker Dec 14, 2016 https://github.com/python-telegram-bot/python-telegram-bot/pull/484/commits/d5ce32c67267eca4e11fe21753bcd97f85e60d8f
cbf93e1 switch to run_x naming scheme jh0ker Dec 14, 2016 https://github.com/python-telegram-bot/python-telegram-bot/pull/484/commits/cbf93e10461be399908e74e670d93e469db16d1e
93bf21a jobqueue.py: stability improvments tsnoam Dec 14, 2016 https://github.com/python-telegram-bot/python-telegram-bot/pull/484/commits/93bf21a0a4ac0c2b99dc7b6a93ab5209c8a89618
ed17859 disable test_send_contact tsnoam Dec 19, 2016 https://github.com/python-telegram-bot/python-telegram-bot/pull/484/commits/ed1785981d5611fd8b50567e67611352937ffe24
423251f Change Job.is_removed to be a property instead of a method tsnoam Dec 19, 2016 https://github.com/python-telegram-bot/python-telegram-bot/pull/484/commits/423251f66cc0323b5e762c9a8eeea8a210283ebe
09cb33f rename Job.is_removed to removed jh0ker Dec 20, 2016 https://github.com/python-telegram-bot/python-telegram-bot/pull/484/commits/09cb33f52d6fb0a0de65b9e76b114c876e10d5b3
Clear filters https://github.com/python-telegram-bot/python-telegram-bot/pull/484/files
Please reload this pagehttps://github.com/python-telegram-bot/python-telegram-bot/pull/484/files
Please reload this pagehttps://github.com/python-telegram-bot/python-telegram-bot/pull/484/files
jobqueue.py https://github.com/python-telegram-bot/python-telegram-bot/pull/484/files#diff-7fa0ddef530ade1b4faa3788c11caad821f1fd96118e2d4be5a5fe9cc3020a8a
test_bot.py https://github.com/python-telegram-bot/python-telegram-bot/pull/484/files#diff-16435365ee487202cae42fc85f2bcb3f6d3883545fbdce46cf68fd5c74abffbb
test_jobqueue.py https://github.com/python-telegram-bot/python-telegram-bot/pull/484/files#diff-604ebef76527742b265682c0ef562d6b19d1a023a4b432e014799fee8ce543b8
Please reload this pagehttps://github.com/python-telegram-bot/python-telegram-bot/pull/484/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.