// Copyright 2021 gRPC authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef GRPC_SRC_CORE_LIB_PROMISE_TRY_JOIN_H #define GRPC_SRC_CORE_LIB_PROMISE_TRY_JOIN_H #include #include #include #include "absl/log/check.h" #include "absl/meta/type_traits.h" #include "absl/status/status.h" #include "absl/status/statusor.h" #include "src/core/lib/promise/detail/join_state.h" #include "src/core/lib/promise/map.h" #include "src/core/lib/promise/poll.h" #include "src/core/lib/promise/status_flag.h" namespace grpc_core { namespace promise_detail { // Extract the T from a StatusOr template T IntoResult(absl::StatusOr* status) { return std::move(**status); } // TryJoin returns a StatusOr> for f()->Poll>, // g()->Poll>, h()->Poll>. If one of those should be a // Status instead, we need a placeholder type to return, and this is it. inline Empty IntoResult(absl::Status*) { return Empty{}; } // Traits object to pass to BasicJoin template