Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make long-running operations consistently return Wait[T] #46

Merged
merged 2 commits into from
Mar 23, 2023
Merged

Make long-running operations consistently return Wait[T] #46

merged 2 commits into from
Mar 23, 2023

Conversation

nfx
Copy link
Contributor

@nfx nfx commented Mar 23, 2023

No description provided.

@nfx nfx requested a review from pietern March 23, 2023 19:51
@nfx nfx merged commit 8d3b91b into main Mar 23, 2023
@nfx nfx deleted the waits branch March 23, 2023 20:07
Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

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

@nfx I think this should stick to the same rules as applied for the Go SDK, where the basic functions (e.g. create) immediately return the create response, and only the _and_wait functions also do the waiting.

That way all functions that map to our APIs 1:1 return a response and not a custom return type. By having some of those functions return a response and others a waiter can be confusing. By having only _and_wait functions return one of these Wait instances (or directly call result) it's immediately clear if it maps to an API call or if it does additional polling and might block for a while.

@nfx
Copy link
Contributor Author

nfx commented Mar 23, 2023

@pietern this is a compatibility layer with other clouds SDK and AIP-151 https://google.aip.dev/151, where long-running operations do return a Future/Promise by default.

it’s one of the topics for discussion tomorrow. Also we should send out a customer survey in a month or so, just to gauge community’s preference.

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.

None yet

2 participants