blob: 4716af2ea7840c4c01f19f6d4f77621cd48aa3f1 [file] [log] [blame]
David Reiss5ddabb82010-10-06 17:09:37 +00001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
Roger Meier49ff8b12012-04-13 09:12:31 +000020#include <thrift/async/TAsyncChannel.h>
Roger Meier82525772012-11-16 00:38:27 +000021#include <thrift/cxxfunctional.h>
David Reiss5ddabb82010-10-06 17:09:37 +000022
Konrad Grochowski16a23a62014-11-13 15:33:38 +010023namespace apache {
24namespace thrift {
25namespace async {
David Reiss5ddabb82010-10-06 17:09:37 +000026
Roger Meier285cfaa2011-07-28 17:51:36 +000027void TAsyncChannel::sendAndRecvMessage(const VoidCallback& cob,
David Reiss5ddabb82010-10-06 17:09:37 +000028 TMemoryBuffer* sendBuf,
29 TMemoryBuffer* recvBuf) {
Konrad Grochowski16a23a62014-11-13 15:33:38 +010030 apache::thrift::stdcxx::function<void()> send_done
31 = apache::thrift::stdcxx::bind(&TAsyncChannel::recvMessage, this, cob, recvBuf);
David Reiss5ddabb82010-10-06 17:09:37 +000032
Roger Meier285cfaa2011-07-28 17:51:36 +000033 sendMessage(send_done, sendBuf);
David Reiss5ddabb82010-10-06 17:09:37 +000034}
Konrad Grochowski16a23a62014-11-13 15:33:38 +010035}
36}
37} // apache::thrift::async