You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2026/06/16 17:54:56 UTC

[PR] refactor(core)!: rework Operator runtime composition API [opendal]

Xuanwo opened a new pull request, #7779:
URL: https://github.com/apache/opendal/pull/7779

   # Which issue does this PR close?
   
   Internal refactor; no tracking issue.
   
   # Rationale for this change
   
   `OperationContext` is part of the public `Operator::from_parts`/`into_parts` surface, so it belongs in `types` rather than behind `raw`. The runtime-composition entry points had also accumulated redundant or unused shapes — `from_service`/`from_inner`/`inner`/`into_inner`/`executor_ref`, separate `http_transport`/`executor` setters, and two parallel layer hooks (`apply_http_transport`/`apply_execute`). This PR collapses them into one consistent model: a layer folds a single `OperationContext`, and the operator is constructed and destructured through `from_parts`/`into_parts`.
   
   # What changes are included in this PR?
   
   - Move `OperationContext` from `raw` to `types/context` as a public type; it is no longer re-exported under `raw`.
   - Merge `Layer::apply_http_transport`/`apply_execute` into a single `apply_context`; replace `Operator::http_transport`/`executor` with `Operator::with_context`.
   - Replace `Operator::from_service`/`from_inner` with `from_parts(ctx, service)` and `into_parts() -> (ctx, service)`; keep `from_inner` as a deprecated alias.
   - Remove the unused `inner`/`into_inner`/`executor_ref` accessors and the internal `with_parts` constructor (folding now goes through `apply_layers`).
   
   # Are there any user-facing changes?
   
   Yes, breaking (needs the `breaking-changes` label):
   
   - `raw::OperationContext` is now `opendal::OperationContext` (crate root).
   - `Operator::{inner, into_inner, executor_ref, http_transport, executor, from_service}` are removed; use `from_parts`/`with_context`. `from_inner` is deprecated in favor of `from_parts`.
   - `Layer` authors implement `apply_context(srv, OperationContext) -> OperationContext` instead of `apply_http_transport`/`apply_execute`.
   
   # AI Usage Statement
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor(core)!: rework Operator runtime composition API [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #7779:
URL: https://github.com/apache/opendal/pull/7779


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org