-
Notifications
You must be signed in to change notification settings - Fork 8
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
Separate services from connectors #36
Conversation
Previously the library attempted to abstract over different HTTP(s) connectors by passing them as generics through various types. Although this allows certain flexibility (e.g. choosing openssl vs rustls), it was probably the wrong abstraction layer in the first place. This change moves most of the genericism to the grpc-service layer for grpc services (bigtable and pubsub). The library's "common" path via builders will provide a sensible default implementation, but it will now be possible to substitute the entire tower::service stack provided to the grpc API. This is more flexible than the prior connector abstraction, but also harder to use (you basically have to build everything yourself). This feels like the right balance between a batteries-included default and a build-your-own option. Along the way I've also made some updates to non-exhaustivity in generated code, to help ease future changes without breaking semver. This is unfortunately less ergonomic, but not _too_ bad. Future changes may include some builder pattern to make protobuf construction easier. The GCS API is still largely the same, however it is still not in an ideal place. Future changes may bring it more towards service abstraction. Finally, this change includes updates to tonic and prost, bringing them up to the latest versions. Supersedes standard-ai#30 Fixes standard-ai#35
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks much nicer! I guess at some point it would be worth having an example using from_raw_api
+ Unpin | ||
+ 'static, | ||
C::Future: Send + Unpin + 'static, | ||
C::Error: Into<Box<dyn std::error::Error + Send + Sync>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
An explicit example could help sure. For now, anyone industrious enough to try it should be able to find the client builder's use of it |
Previously the library attempted to abstract over different HTTP(s) connectors by passing them as generics through various types. Although this allows certain flexibility (e.g. choosing openssl vs rustls), it was probably the wrong abstraction layer in the first place.
This change moves most of the genericism to the grpc-service layer for grpc services (bigtable and pubsub). The library's "common" path via builders will provide a sensible default implementation, but it will now be possible to substitute the entire tower::service stack provided to the grpc API. This is more flexible than the prior connector abstraction, but also harder to use (you basically have to build everything yourself). This feels like the right balance between a batteries-included default and a build-your-own option.
Along the way I've also made some updates to non-exhaustivity in generated code, to help ease future changes without breaking semver. This is unfortunately less ergonomic, but not too bad. Future changes may include some builder pattern to make protobuf construction easier.
The GCS API is still largely the same, however it is still not in an ideal place. Future changes may bring it more towards service abstraction.
Finally, this change includes updates to tonic and prost, bringing them up to the latest versions.
Supersedes #30
Fixes #35