Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-17 08:35:01

0001 /*
0002  * Licensed to the Apache Software Foundation (ASF) under one
0003  * or more contributor license agreements. See the NOTICE file
0004  * distributed with this work for additional information
0005  * regarding copyright ownership. The ASF licenses this file
0006  * to you under the Apache License, Version 2.0 (the
0007  * "License"); you may not use this file except in compliance
0008  * with the License. You may obtain a copy of the License at
0009  *
0010  *   http://www.apache.org/licenses/LICENSE-2.0
0011  *
0012  * Unless required by applicable law or agreed to in writing,
0013  * software distributed under the License is distributed on an
0014  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
0015  * KIND, either express or implied. See the License for the
0016  * specific language governing permissions and limitations
0017  * under the License.
0018  */
0019 
0020 #ifndef _THRIFT_TASYNC_BUFFER_PROCESSOR_H_
0021 #define _THRIFT_TASYNC_BUFFER_PROCESSOR_H_ 1
0022 
0023 #include <functional>
0024 #include <memory>
0025 #include <thrift/transport/TBufferTransports.h>
0026 
0027 namespace apache {
0028 namespace thrift {
0029 namespace async {
0030 
0031 class TAsyncBufferProcessor {
0032 public:
0033   // Process data in "in", putting the result in "out".
0034   // Call _return(true) when done, or _return(false) to
0035   // forcefully close the connection (if applicable).
0036   // "in" and "out" should be TMemoryBuffer or similar,
0037   // not a wrapper around a socket.
0038   virtual void process(std::function<void(bool healthy)> _return,
0039                        std::shared_ptr<transport::TBufferBase> ibuf,
0040                        std::shared_ptr<transport::TBufferBase> obuf) = 0;
0041   virtual ~TAsyncBufferProcessor() = default;
0042 };
0043 }
0044 }
0045 } // apache::thrift::async
0046 
0047 #endif // #ifndef _THRIFT_TASYNC_BUFFER_PROCESSOR_H_