Skip to content

feat(common): Add converting constructors for future#8329

Merged
coryan merged 4 commits into
googleapis:mainfrom
dpcollins-google:retry_policy_refactor
Feb 17, 2022
Merged

feat(common): Add converting constructors for future#8329
coryan merged 4 commits into
googleapis:mainfrom
dpcollins-google:retry_policy_refactor

Conversation

@dpcollins-google
Copy link
Copy Markdown
Contributor

@dpcollins-google dpcollins-google commented Feb 10, 2022

When the value type of a future is convertible to the value type of another, this allows the futures to interconvert.

This is useful with, for example, make_ready_future, where one could return make_ready_future(absl::nullopt) for a return type of future<absl::optional<Result>>


This change is Reviewable

@dpcollins-google dpcollins-google requested a review from a team February 10, 2022 02:48
@google-cloud-cpp-bot
Copy link
Copy Markdown
Contributor

Google Cloud Build Logs
For commit: b732e25db9d8ba3184e6ed692d6ac85f3bb53156

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 10, 2022

Codecov Report

Merging #8329 (fd03071) into main (541eb09) will decrease coverage by 0.01%.
The diff coverage is 91.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8329      +/-   ##
==========================================
- Coverage   95.09%   95.08%   -0.02%     
==========================================
  Files        1360     1360              
  Lines      121124   121136      +12     
==========================================
- Hits       115185   115181       -4     
- Misses       5939     5955      +16     
Impacted Files Coverage Δ
google/cloud/future_generic_test.cc 98.58% <80.00%> (-0.23%) ⬇️
google/cloud/future_generic.h 100.00% <100.00%> (ø)
google/cloud/future_void.h 100.00% <100.00%> (ø)
google/cloud/future_void_test.cc 98.18% <100.00%> (+0.01%) ⬆️
...e/cloud/spanner/testing/cleanup_stale_instances.cc 61.29% <0.00%> (-19.36%) ⬇️
google/cloud/bigtable/internal/common_client.h 94.02% <0.00%> (-5.98%) ⬇️
google/cloud/internal/filesystem.h 91.83% <0.00%> (-4.09%) ⬇️
google/cloud/internal/filesystem.cc 92.85% <0.00%> (-1.43%) ⬇️
google/cloud/pubsub/subscriber_connection_test.cc 97.22% <0.00%> (-0.70%) ⬇️
google/cloud/bigtable/async_read_stream_test.cc 97.32% <0.00%> (-0.67%) ⬇️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 541eb09...fd03071. Read the comment docs.

Copy link
Copy Markdown
Contributor

@coryan coryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The robots have things to say, I agree with my robot overlords.

Comment thread google/cloud/future_generic.h Outdated
Comment thread google/cloud/future_generic.h Outdated
Comment thread google/cloud/future_void.h Outdated
@google-cloud-cpp-bot
Copy link
Copy Markdown
Contributor

Google Cloud Build Logs
For commit: 77e43b531fb4d0bb7430df4404704802537cf480

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@google-cloud-cpp-bot
Copy link
Copy Markdown
Contributor

Google Cloud Build Logs
For commit: d828e1e7a60df6d51bb4244bb0279e13318d39ce

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@google-cloud-cpp-bot
Copy link
Copy Markdown
Contributor

Google Cloud Build Logs
For commit: 1d4f49f9b26af8ab1886d30a877d220a8918e850

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@coryan coryan changed the title feat(core): Add converting constructors for future feat(common): Add converting constructors for future Feb 11, 2022
@coryan
Copy link
Copy Markdown
Contributor

coryan commented Feb 11, 2022

Can you please rebase? We have been making a lot of changes to our builds and you are missing some support scripts / changes.

@coryan
Copy link
Copy Markdown
Contributor

coryan commented Feb 16, 2022

Ping.

When the value type of a future is convertible to the value type of another, this allows the futures to interconvert.

This is useful with, for example, make_ready_future, where one could return `make_ready_future(absl::nullopt)` for a return type of `future<absl::optional<Result>>`
@google-cloud-cpp-bot
Copy link
Copy Markdown
Contributor

Google Cloud Build Logs
For commit: fd030716ef9900e6d55d38bb81d761270356acd2

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@dpcollins-google
Copy link
Copy Markdown
Contributor Author

Can you please rebase? We have been making a lot of changes to our builds and you are missing some support scripts / changes.

Done.

@dpcollins-google dpcollins-google enabled auto-merge (squash) February 17, 2022 15:01
@coryan coryan disabled auto-merge February 17, 2022 15:42
@coryan coryan enabled auto-merge (squash) February 17, 2022 15:43
@coryan coryan merged commit 5837957 into googleapis:main Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants