-
Notifications
You must be signed in to change notification settings - Fork 252
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
[Tracking Issue] Convert Cosmos to Pipeline Architecture #290
Comments
This converts from the older req/res-style API into the newer pipeline-based API (ref: Azure#290).
This converts from the older req/res-style API into the newer pipeline-based API (ref: Azure#290).
This converts from the older req/res-style API into the newer pipeline-based API (ref: #290).
|
I'll pick up create_permission, get_permission, replace_permission, and delete_permission |
This change begins the migration process for moving get_document to the new pipelines architecture. Most of the code is moved over now, but the example programs still need updated. Issue Azure#290
I've started working on |
* [Cosmos] Start migrating get_document to pipelines This change begins the migration process for moving get_document to the new pipelines architecture. Most of the code is moved over now, but the example programs still need updated. Issue #290 * Make examples compile with get_document pipelines version * Remove dead code * Fix e2e test compilation errors
I have started working on |
I'll start on EDIT: Also |
I have started |
@rylev is this issue meant for CosmosDB only? |
#677 claimed to complete this 🥳 |
This is a tracking issue for converting operations over to the pipeline architecture. There are some sub issues for converting individual SDK crates over, but this issue acts as a guide for how to switch to the new architecture.
Overview
Previous to the pipeline architecture, each operation was independently controlled meaning there was no central way to control the way operations were performed.
The pipeline architecture on the other hand allows users of the SDK to create pipelines through which outgoing requests and incoming responses are processed. The pipeline are composed of "policies" which can both change the outgoing request and the incoming response. Policies are usually either on a "per-request" basis (meaning they are called only once per operation) or "per-retry" (meaning they are applied every time an operation is attempted).
Examples of policies are the
TelemetryPolicy
which adds various telemetry headers to the request and the retry policy which checks whether an incoming response was successful and if it detects a transient failure, retries the request.Converting to the Architecture
For an example of converting one operation (Cosmos's
get_database
operation) over to the pipeline architecture, take a look at #286.The basic steps are:
operations
module where the operation will live. This submodule should be named after the operation (e.g., forget_database
it's calledget_database
).get_database
theGetDatabaseBuilder
) to new operation submodule and rename it fromBuilder
toOptions
(e.g.,GetDatabaseBuilder =>
GetDatabaseOptions`). This now represents the options that can be supplied when performing the operation. Note that many options that were part of the builder are no longer valid options because there will be individual policies that take their place. For instance, previously many operations took an option to set the user agent. This is now done by a policy.execute
method to adecorate_request
method that instead of performing the request, simply mutates a request parameter with any of the options supplied.get_database
theGetDatabaseResponse
type from theresponses
submodule to the operation submodule. Previously astd::convert::TryFrom
implementation was used to convert from anhttp::Response<Bytes>
object. This should now be a plain associated async function calledtry_from
that converts from the newResponse
type. See the example for how this should be done.get_database
this was theDatabaseClient::get_database
) to use the new options and response types with the pipeline. Again, see the example for how this should be done.Todos
delete_attachment
get_attachment
list_attachments
create_collection
delete_collection
get_collection
list_collections
replace_collection
create_database
delete_database
list_databases
get_database
create_document
delete_document
get_document
replace_document
list_documents
query_documents
get_partition_key_ranges
create_permission
delete_permission
get_permission
replace_permission
list_permissions
create_reference_attachment
replace_reference_attachment
create_slug_attachment
create_stored_procedure
delete_stored_procedure
execute_stored_procedure
replace_stored_procedure
list_stored_procedures
create_trigger
delete_trigger
list_triggers
create_user
delete_user
get_user
replace_user
create_user_defined_function
delete_user_defined_function
list_user_defined_functions
list_users
The text was updated successfully, but these errors were encountered: