René's URL Explorer Experiment


Title: evaluate the possibility of Future API surface · Issue #533 · microsoftgraph/msgraph-sdk-java · GitHub

Open Graph Title: evaluate the possibility of Future API surface · Issue #533 · microsoftgraph/msgraph-sdk-java

X Title: evaluate the possibility of Future API surface · Issue #533 · microsoftgraph/msgraph-sdk-java

Description: Context: java's equivalent to Promises/Tasks are Futures. Adding an API surface that returns Futures (and potentially removing the callback one??) would enable our customers to write modern Java in their applications I suppose so but my ...

Open Graph Description: Context: java's equivalent to Promises/Tasks are Futures. Adding an API surface that returns Futures (and potentially removing the callback one??) would enable our customers to write modern Java in...

X Description: Context: java's equivalent to Promises/Tasks are Futures. Adding an API surface that returns Futures (and potentially removing the callback one??) would enable our customers to write modern Jav...

Opengraph URL: https://github.com/microsoftgraph/msgraph-sdk-java/issues/533

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"evaluate the possibility of Future API surface","articleBody":"Context: java's equivalent to Promises/Tasks are Futures. Adding an API surface that returns Futures (and potentially removing the callback one??) would enable our customers to write modern Java in their applications\r\n\r\nI suppose so but my callback wrapper is pretty straightforward; it wasn't a huge deal writing it.\r\n\r\n```scala\r\nobject ICallbackWrapper extends StrictLogging {\r\n\r\n  private def cbF[T](): (Future[T], ICallback[T]) = {\r\n    val p = Promise[T]()\r\n    val cb = new ICallback[T] {\r\n      override def success(result: T): Unit = {\r\n        val _ = p.trySuccess(result)\r\n      }\r\n\r\n      override def failure(ex: ClientException): Unit = {\r\n        val _ = p.tryFailure(ex)\r\n      }\r\n    }\r\n\r\n    (p.future, cb)\r\n  }\r\n\r\n  def toFut[T](fun: ICallback[T] => Unit)(\r\n      implicit\r\n      ec: ExecutionContext,\r\n  ): Future[T] = {\r\n    val (f, cb) = cbF[T]()\r\n\r\n    Limiter.apiFut {\r\n      () =>\r\n        fun(cb)\r\n        f\r\n    }\r\n  }\r\n\r\n  def toFut[V, T](v: V, fun: (V, ICallback[T]) => Unit)(\r\n      implicit\r\n      ec: ExecutionContext,\r\n  ): Future[T] = {\r\n    val (f, cb) = cbF[T]()\r\n\r\n    Limiter.apiFut {\r\n      () =>\r\n        fun(v, cb)\r\n        f\r\n    }\r\n  }\r\n\r\n  def uploadFut[V, T](v: V, len: Long, fun: (V, ICallback[T]) => Unit)(\r\n      implicit\r\n      ec: ExecutionContext,\r\n  ): Future[T] = {\r\n    val (f, cb) = cbF[T]()\r\n\r\n    Limiter.attachFut(\r\n      () => {\r\n        fun(v, cb)\r\n        f\r\n      },\r\n      len,\r\n    )\r\n  }\r\n}\r\n```\r\n\r\nBy far the biggest issue with using graph are the very restrictive rate limits... I shimmed a \"rate limiter\" into the above wrapper so I'm able to limit both number of simultaneous connections as well as ensure uploads don't go over the 15mb/30 sec limit.  It took a lot of trial and error getting the futures passed just right so I didn't go over the max 4 connection cap, but it seems to be working well in practice.\r\n\r\n_Originally posted by @lespea in https://github.com/microsoftgraph/msgraph-sdk-java/issue_comments/705202102_ \r\n[AB#6315](https://microsoftgraph.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_workitems/edit/6315)","author":{"url":"https://github.com/baywet","@type":"Person","name":"baywet"},"datePublished":"2020-10-08T12:06:23Z","url":"https://github.com/microsoftgraph/msgraph-sdk-java/issues/533"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:a2c0ed7d-50dc-60b8-f286-70d4b9c13632
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9B90:3EE5E8:1226CE4:17BC1A5:6B053A9B
html-safe-nonceb49c4891bf2e5c7d23beba6f4191e2d9e7e4f3e24862174f7555353f8b18149a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjkwOjNFRTVFODoxMjI2Q0U0OjE3QkMxQTU6NkIwNTNBOUIiLCJ2aXNpdG9yX2lkIjoiMjMwNjc3MzIyMjU5NTc3NDk5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac2fc7a2257c1ec0e8e533448728eebd2b4465a48bd89309d5f0f83e6cad1d2d45
hovercard-subject-tagissue:717284760
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoftgraph/msgraph-sdk-java/533/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7813ec9292c5fa3d87156e432c4608fe67d28cd228c476ef8b31afa42649beac/microsoftgraph/msgraph-sdk-java/issues/533
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7813ec9292c5fa3d87156e432c4608fe67d28cd228c476ef8b31afa42649beac/microsoftgraph/msgraph-sdk-java/issues/533
og:image:altContext: java's equivalent to Promises/Tasks are Futures. Adding an API surface that returns Futures (and potentially removing the callback one??) would enable our customers to write modern Java in...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebaywet
hostnamegithub.com
expected-hostnamegithub.com
None854d880890b5e847b3fce9d1b31f032107baeddeebad2aa379c48aa4f1451f6b
turbo-cache-controlno-preview
go-importgithub.com/microsoftgraph/msgraph-sdk-java git https://github.com/microsoftgraph/msgraph-sdk-java.git
octolytics-dimension-user_id17304259
octolytics-dimension-user_loginmicrosoftgraph
octolytics-dimension-repository_id103300409
octolytics-dimension-repository_nwomicrosoftgraph/msgraph-sdk-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id103300409
octolytics-dimension-repository_network_root_nwomicrosoftgraph/msgraph-sdk-java
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release220e980097d94ce616d5d11fbd5316d208e3fc93
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoftgraph/msgraph-sdk-java/issues/533#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoftgraph%2Fmsgraph-sdk-java%2Fissues%2F533
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoftgraph%2Fmsgraph-sdk-java%2Fissues%2F533
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoftgraph%2Fmsgraph-sdk-java
Reloadhttps://github.com/microsoftgraph/msgraph-sdk-java/issues/533
Reloadhttps://github.com/microsoftgraph/msgraph-sdk-java/issues/533
Reloadhttps://github.com/microsoftgraph/msgraph-sdk-java/issues/533
microsoftgraphhttps://github.com/microsoftgraph
msgraph-sdk-javahttps://github.com/microsoftgraph/msgraph-sdk-java
Codehttps://github.com/microsoftgraph/msgraph-sdk-java
Issues107 (107)https://github.com/microsoftgraph/msgraph-sdk-java/issues
Pull requests23 (23)https://github.com/microsoftgraph/msgraph-sdk-java/pulls
Actionshttps://github.com/microsoftgraph/msgraph-sdk-java/actions
Projectshttps://github.com/microsoftgraph/msgraph-sdk-java/projects
Security and qualityhttps://github.com/microsoftgraph/msgraph-sdk-java/security
Insightshttps://github.com/microsoftgraph/msgraph-sdk-java/insights
https://github.com/microsoftgraph/msgraph-sdk-java
New issuehttps://github.com/login?return_to=https://github.com/microsoftgraph/msgraph-sdk-java/issues/533
New issuehttps://github.com/login?return_to=https://github.com/microsoftgraph/msgraph-sdk-java/issues/533
#610https://github.com/microsoftgraph/msgraph-sdk-java/pull/610
evaluate the possibility of Future API surfacehttps://github.com/microsoftgraph/msgraph-sdk-java/issues/533#top
#610https://github.com/microsoftgraph/msgraph-sdk-java/pull/610
https://github.com/baywet
ADO to GitHub automation labelhttps://github.com/microsoftgraph/msgraph-sdk-java/issues?q=state%3Aopen%20label%3A%22ADO%20to%20GitHub%20automation%20label%22
enhancementhttps://github.com/microsoftgraph/msgraph-sdk-java/issues?q=state%3Aopen%20label%3A%22enhancement%22
under-investigationhttps://github.com/microsoftgraph/msgraph-sdk-java/issues?q=state%3Aopen%20label%3A%22under-investigation%22
3.0.0-previewhttps://github.com/microsoftgraph/msgraph-sdk-java/milestone/4
https://github.com/baywet
Vincent Biret (baywet)https://github.com/baywet
on Oct 8, 2020https://github.com/microsoftgraph/msgraph-sdk-java/issues/533#issue-717284760
Adam Lesperance (@lespea)https://github.com/lespea
https://github.com/microsoftgraph/msgraph-sdk-java/issue_comments/705202102https://github.com/microsoftgraph/msgraph-sdk-java/issue_comments/705202102
AB#6315https://microsoftgraph.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_workitems/edit/6315
ToTriagehttps://github.com/microsoftgraph/msgraph-sdk-java/issues?q=state%3Aopen%20label%3A%22ToTriage%22
on Oct 8, 2020https://github.com/microsoftgraph/msgraph-sdk-java/issues/533#event-3855072488
Vincent Biret (baywet)https://github.com/baywet
on Oct 8, 2020https://github.com/microsoftgraph/msgraph-sdk-java/issues/533#event-3855072559
ToTriagehttps://github.com/microsoftgraph/msgraph-sdk-java/issues?q=state%3Aopen%20label%3A%22ToTriage%22
on Oct 8, 2020https://github.com/microsoftgraph/msgraph-sdk-java/issues/533#event-3855072695
Vincent Biret (baywet)https://github.com/baywet
3.0.0https://github.com/microsoftgraph/msgraph-sdk-java/milestone/4
on Oct 8, 2020https://github.com/microsoftgraph/msgraph-sdk-java/issues/533#event-3855073182
Vincent Biret (baywet)https://github.com/baywet
enhancementhttps://github.com/microsoftgraph/msgraph-sdk-java/issues?q=state%3Aopen%20label%3A%22enhancement%22
ADO to GitHub automation labelhttps://github.com/microsoftgraph/msgraph-sdk-java/issues?q=state%3Aopen%20label%3A%22ADO%20to%20GitHub%20automation%20label%22
on Oct 8, 2020https://github.com/microsoftgraph/msgraph-sdk-java/issues/533#event-3855073945
https://github.com/baywet
Vincent Biret (baywet)https://github.com/baywet
on Nov 17, 2020https://github.com/microsoftgraph/msgraph-sdk-java/issues/533#issuecomment-729135483
https://developer.android.com/reference/java/util/concurrent/FutureTask?hl=enhttps://developer.android.com/reference/java/util/concurrent/FutureTask?hl=en
https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.htmlhttps://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html
https://github.com/baywet
Vincent Biret (baywet)https://github.com/baywet
on Nov 26, 2020https://github.com/microsoftgraph/msgraph-sdk-java/issues/533#issuecomment-734456067
has a better designhttps://stackoverflow.com/a/54328028/3808675
https://github.com/baywet
Vincent Biret (baywet)https://github.com/baywet
on Dec 14, 2020https://github.com/microsoftgraph/msgraph-sdk-java/issues/533#issuecomment-744668185
asyncTaskhttps://developer.android.com/reference/android/os/AsyncTask
Vincent Biret (baywet)https://github.com/baywet
under-investigationhttps://github.com/microsoftgraph/msgraph-sdk-java/issues?q=state%3Aopen%20label%3A%22under-investigation%22
on Dec 15, 2020https://github.com/microsoftgraph/msgraph-sdk-java/issues/533#event-4114605541
https://github.com/baywet
Vincent Biret (baywet)https://github.com/baywet
on Dec 18, 2020https://github.com/microsoftgraph/msgraph-sdk-java/issues/533#issuecomment-748316793
https://github.com/baywet
Vincent Biret (baywet)https://github.com/baywet
on Dec 29, 2020https://github.com/microsoftgraph/msgraph-sdk-java/issues/533#issuecomment-752238990
https://www.mocklab.io/blog/which-java-http-client-should-i-use-in-2020/https://www.mocklab.io/blog/which-java-http-client-should-i-use-in-2020/
https://github.com/baywet
Vincent Biret (baywet)https://github.com/baywet
on Jan 8, 2021https://github.com/microsoftgraph/msgraph-sdk-java/issues/533#issuecomment-756808228
CompletableFuturehttps://developer.android.com/reference/java/util/concurrent/CompletableFuture
javahttps://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html
https://github.com/baywet
Vincent Biret (baywet)https://github.com/baywet
on Jan 8, 2021https://github.com/microsoftgraph/msgraph-sdk-java/issues/533#issuecomment-756859028
seems superior to a callback onehttp://jayconrod.com/posts/93/futures-are-better-than-callbacks
FutureTaskshttps://docs.oracle.com/javase/7/docs/api/java/util/concurrent/FutureTask.html
wrapping the enqueue callhttps://stackoverflow.com/questions/41833314/how-to-make-concurrent-network-requests-using-okhttp
guava's ListenableFutureshttps://guava.dev/releases/21.0/api/docs/com/google/common/util/concurrent/ListenableFuture.html
Azure SDKshttps://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-java?tabs=powershell
completable futures and monoshttps://devblogs.microsoft.com/azure-sdk/async-programming-with-project-reactor/
https://github.com/baywet
Vincent Biret (baywet)https://github.com/baywet
on Jan 13, 2021https://github.com/microsoftgraph/msgraph-sdk-java/issues/533#issuecomment-759642460
see the original commenthttps://github.com/microsoftgraph/msgraph-sdk-java-core/pull/42#issuecomment-759559062
Vincent Biret (baywet)https://github.com/baywet
feature/future #610https://github.com/microsoftgraph/msgraph-sdk-java/pull/610
on Jan 13, 2021https://github.com/microsoftgraph/msgraph-sdk-java/issues/533#event-4203265259
Vincent Biret (baywet)https://github.com/baywet
completedhttps://github.com/microsoftgraph/msgraph-sdk-java/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jan 19, 2021https://github.com/microsoftgraph/msgraph-sdk-java/issues/533#event-4225000741
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoftgraph/msgraph-sdk-java/issues/533
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoftgraph/msgraph-sdk-java/issues/533
Vincent Biret (baywet)https://github.com/baywet
ADO to GitHub automation labelhttps://github.com/microsoftgraph/msgraph-sdk-java/issues?q=state%3Aopen%20label%3A%22ADO%20to%20GitHub%20automation%20label%22
enhancementhttps://github.com/microsoftgraph/msgraph-sdk-java/issues?q=state%3Aopen%20label%3A%22enhancement%22
under-investigationhttps://github.com/microsoftgraph/msgraph-sdk-java/issues?q=state%3Aopen%20label%3A%22under-investigation%22
3.0.0-previewhttps://github.com/microsoftgraph/msgraph-sdk-java/milestone/4
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.