From 89cd9a2eef62a954b9084ace45f79ebce549cf4b Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 11 Dec 2024 20:38:06 -0800 Subject: [PATCH] api-sketch --- .../transport/chaotic_good/frame_transport.h | 34 ++++++++++++++++ .../chaotic_good/tcp_frame_transport.h | 39 +++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 src/core/ext/transport/chaotic_good/frame_transport.h create mode 100644 src/core/ext/transport/chaotic_good/tcp_frame_transport.h diff --git a/src/core/ext/transport/chaotic_good/frame_transport.h b/src/core/ext/transport/chaotic_good/frame_transport.h new file mode 100644 index 0000000000000..df369ea9d3d8f --- /dev/null +++ b/src/core/ext/transport/chaotic_good/frame_transport.h @@ -0,0 +1,34 @@ +// Copyright 2024 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_EXT_TRANSPORT_CHAOTIC_GOOD_FRAME_TRANSPORT_H +#define GRPC_SRC_CORE_EXT_TRANSPORT_CHAOTIC_GOOD_FRAME_TRANSPORT_H + +#include "src/core/ext/transport/chaotic_good/frame.h" +#include "src/core/lib/promise/mpsc.h" +#include "src/core/lib/promise/party.h" + +namespace grpc_core { +namespace chaotic_good { + +class FrameTransport { + public: + virtual void StartReading(Party* party, MpscSender frames) = 0; + virtual void StartWriting(Party* party, MpscReceiver frames) = 0; +}; + +} // namespace chaotic_good +} // namespace grpc_core + +#endif diff --git a/src/core/ext/transport/chaotic_good/tcp_frame_transport.h b/src/core/ext/transport/chaotic_good/tcp_frame_transport.h new file mode 100644 index 0000000000000..e5b8a1d94f541 --- /dev/null +++ b/src/core/ext/transport/chaotic_good/tcp_frame_transport.h @@ -0,0 +1,39 @@ +// Copyright 2024 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_EXT_TRANSPORT_CHAOTIC_GOOD_TCP_FRAME_TRANSPORT_H +#define GRPC_SRC_CORE_EXT_TRANSPORT_CHAOTIC_GOOD_TCP_FRAME_TRANSPORT_H + +#include + +#include "pending_connection.h" +#include "src/core/ext/transport/chaotic_good/frame_transport.h" + +namespace grpc_core { +namespace chaotic_good { + +class TcpFrameTransport final : public FrameTransport { + public: + TcpFrameTransport(PromiseEndpoint control_endpoint, + std::vector pending_data_endpoints); + + private: + Poll PollWrite(Frame& frame) override; + Poll> PollRead() override; +}; + +} // namespace chaotic_good +} // namespace grpc_core + +#endif