From: David Reiss Date: Tue, 24 Mar 2009 20:01:25 +0000 (+0000) Subject: THRIFT-136. s/async/oneway/ in comments X-Git-Tag: 0.2.0~227 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=c51986f43897a64531935653cb4a2462f6cd7e11;p=common%2Fthrift.git THRIFT-136. s/async/oneway/ in comments This is an internal-only change. git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757990 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/compiler/cpp/src/generate/t_cpp_generator.cc b/compiler/cpp/src/generate/t_cpp_generator.cc index 788f7acd..5ad390a7 100644 --- a/compiler/cpp/src/generate/t_cpp_generator.cc +++ b/compiler/cpp/src/generate/t_cpp_generator.cc @@ -1698,7 +1698,7 @@ void t_cpp_generator::generate_service_client(t_service* tservice) { scope_down(f_service_); f_service_ << endl; - // Generate recv function only if not an async function + // Generate recv function only if not an oneway function if (!(*f_iter)->is_oneway()) { t_struct noargs(program_); t_function recv_function((*f_iter)->get_returntype(), @@ -2100,7 +2100,7 @@ void t_cpp_generator::generate_process_function(t_service* tservice, } f_service_ << indent() << "}" << endl; - // Shortcut out here for async functions + // Shortcut out here for oneway functions if (tfunction->is_oneway()) { f_service_ << indent() << "return;" << endl; diff --git a/compiler/cpp/src/generate/t_hs_generator.cc b/compiler/cpp/src/generate/t_hs_generator.cc index bcc5ff55..18a07f0c 100644 --- a/compiler/cpp/src/generate/t_hs_generator.cc +++ b/compiler/cpp/src/generate/t_hs_generator.cc @@ -1020,7 +1020,7 @@ void t_hs_generator::generate_process_function(t_service* tservice, - // Shortcut out here for async functions + // Shortcut out here for oneway functions if (tfunction->is_oneway()) { f_service_ << indent() << "return ()" << endl; diff --git a/compiler/cpp/src/generate/t_java_generator.cc b/compiler/cpp/src/generate/t_java_generator.cc index 057e6ce0..e258a470 100644 --- a/compiler/cpp/src/generate/t_java_generator.cc +++ b/compiler/cpp/src/generate/t_java_generator.cc @@ -2066,7 +2066,7 @@ void t_java_generator::generate_process_function(t_service* tservice, const std::vector& xceptions = xs->get_members(); vector::const_iterator x_iter; - // Declare result for non async function + // Declare result for non oneway function if (!tfunction->is_oneway()) { f_service_ << indent() << resultname << " result = new " << resultname << "();" << endl; @@ -2125,7 +2125,7 @@ void t_java_generator::generate_process_function(t_service* tservice, f_service_ << endl; } - // Shortcut out here for async functions + // Shortcut out here for oneway functions if (tfunction->is_oneway()) { f_service_ << indent() << "return;" << endl; diff --git a/compiler/cpp/src/generate/t_ocaml_generator.cc b/compiler/cpp/src/generate/t_ocaml_generator.cc index 1464618e..a60e00c2 100644 --- a/compiler/cpp/src/generate/t_ocaml_generator.cc +++ b/compiler/cpp/src/generate/t_ocaml_generator.cc @@ -1096,7 +1096,7 @@ void t_ocaml_generator::generate_process_function(t_service* tservice, const std::vector& xceptions = xs->get_members(); vector::const_iterator x_iter; - // Declare result for non async function + // Declare result for non oneway function if (!tfunction->is_oneway()) { f_service_ << indent() << "let result = new " << resultname << " in" << endl; @@ -1149,7 +1149,7 @@ void t_ocaml_generator::generate_process_function(t_service* tservice, - // Shortcut out here for async functions + // Shortcut out here for oneway functions if (tfunction->is_oneway()) { f_service_ << indent() << "()" << endl; diff --git a/compiler/cpp/src/generate/t_perl_generator.cc b/compiler/cpp/src/generate/t_perl_generator.cc index 9a6535d2..02ac7792 100644 --- a/compiler/cpp/src/generate/t_perl_generator.cc +++ b/compiler/cpp/src/generate/t_perl_generator.cc @@ -824,7 +824,7 @@ void t_perl_generator::generate_process_function(t_service* tservice, const std::vector& xceptions = xs->get_members(); vector::const_iterator x_iter; - // Declare result for non async function + // Declare result for non oneway function if (!tfunction->is_oneway()) { f_service_ << indent() << "my $result = new " << resultname << "();" << endl; @@ -877,7 +877,7 @@ void t_perl_generator::generate_process_function(t_service* tservice, f_service_ << "}" << endl; } - // Shortcut out here for async functions + // Shortcut out here for oneway functions if (tfunction->is_oneway()) { f_service_ << indent() << "return;" << endl; diff --git a/compiler/cpp/src/generate/t_php_generator.cc b/compiler/cpp/src/generate/t_php_generator.cc index b0e4ac62..f74076c1 100644 --- a/compiler/cpp/src/generate/t_php_generator.cc +++ b/compiler/cpp/src/generate/t_php_generator.cc @@ -1057,7 +1057,7 @@ void t_php_generator::generate_process_function(t_service* tservice, const std::vector& xceptions = xs->get_members(); vector::const_iterator x_iter; - // Declare result for non async function + // Declare result for non oneway function if (!tfunction->is_oneway()) { f_service_ << indent() << "$result = new " << resultname << "();" << endl; @@ -1108,7 +1108,7 @@ void t_php_generator::generate_process_function(t_service* tservice, f_service_ << "}" << endl; } - // Shortcut out here for async functions + // Shortcut out here for oneway functions if (tfunction->is_oneway()) { f_service_ << indent() << "return;" << endl; diff --git a/compiler/cpp/src/generate/t_py_generator.cc b/compiler/cpp/src/generate/t_py_generator.cc index 52e29924..a5c6151d 100644 --- a/compiler/cpp/src/generate/t_py_generator.cc +++ b/compiler/cpp/src/generate/t_py_generator.cc @@ -1494,7 +1494,7 @@ void t_py_generator::generate_process_function(t_service* tservice, const std::vector& xceptions = xs->get_members(); vector::const_iterator x_iter; - // Declare result for non async function + // Declare result for non oneway function if (!tfunction->is_oneway()) { f_service_ << indent() << "result = " << resultname << "()" << endl; @@ -1520,7 +1520,7 @@ void t_py_generator::generate_process_function(t_service* tservice, } f_service_ << ")" << endl; - // Shortcut out here for async functions + // Shortcut out here for oneway functions if (tfunction->is_oneway()) { f_service_ << indent() << "return d" << endl; @@ -1643,7 +1643,7 @@ void t_py_generator::generate_process_function(t_service* tservice, } } - // Shortcut out here for async functions + // Shortcut out here for oneway functions if (tfunction->is_oneway()) { f_service_ << indent() << "return" << endl; diff --git a/compiler/cpp/src/generate/t_rb_generator.cc b/compiler/cpp/src/generate/t_rb_generator.cc index 6b057f0f..d3ac711b 100644 --- a/compiler/cpp/src/generate/t_rb_generator.cc +++ b/compiler/cpp/src/generate/t_rb_generator.cc @@ -883,7 +883,7 @@ void t_rb_generator::generate_process_function(t_service* tservice, const std::vector& xceptions = xs->get_members(); vector::const_iterator x_iter; - // Declare result for non async function + // Declare result for non oneway function if (!tfunction->is_oneway()) { f_service_ << indent() << "result = " << resultname << ".new()" << endl; @@ -933,7 +933,7 @@ void t_rb_generator::generate_process_function(t_service* tservice, indent(f_service_) << "end" << endl; } - // Shortcut out here for async functions + // Shortcut out here for oneway functions if (tfunction->is_oneway()) { f_service_ << indent() << "return" << endl; diff --git a/lib/cpp/src/server/TNonblockingServer.cpp b/lib/cpp/src/server/TNonblockingServer.cpp index 583877b7..34a0d88d 100644 --- a/lib/cpp/src/server/TNonblockingServer.cpp +++ b/lib/cpp/src/server/TNonblockingServer.cpp @@ -337,7 +337,7 @@ void TConnection::transition() { return; } - // In this case, the request was asynchronous and we should fall through + // In this case, the request was oneway and we should fall through // right back into the read frame header state goto LABEL_APP_INIT; diff --git a/lib/erl/src/thrift_client.erl b/lib/erl/src/thrift_client.erl index 802c0096..40eb5dde 100644 --- a/lib/erl/src/thrift_client.erl +++ b/lib/erl/src/thrift_client.erl @@ -98,7 +98,7 @@ cast(Client, Function, Args) gen_server:cast(Client, {call, Function, Args}). %% Sends a function call but does not read the result. This is useful -%% if you're trying to log non-async function calls to write-only +%% if you're trying to log non-oneway function calls to write-only %% transports like thrift_disk_log_transport. send_call(Client, Function, Args) when is_pid(Client), is_atom(Function), is_list(Args) -> diff --git a/lib/erl/src/thrift_processor.erl b/lib/erl/src/thrift_processor.erl index 0ad65571..2f5a81b5 100644 --- a/lib/erl/src/thrift_processor.erl +++ b/lib/erl/src/thrift_processor.erl @@ -97,7 +97,7 @@ handle_success(State = #thrift_processor{out_protocol = OProto, send_reply(OProto, Function, ?tMessageType_REPLY, {ReplyType, {StructName}}); ok when ReplyType == async_void -> - %% no reply for async void + %% no reply for oneway void ok end. diff --git a/lib/java/src/org/apache/thrift/server/TNonblockingServer.java b/lib/java/src/org/apache/thrift/server/TNonblockingServer.java index e5f49df3..09047453 100644 --- a/lib/java/src/org/apache/thrift/server/TNonblockingServer.java +++ b/lib/java/src/org/apache/thrift/server/TNonblockingServer.java @@ -634,7 +634,7 @@ public class TNonblockingServer extends TServer { readBufferBytesAllocated -= buffer_.array().length; if (response_.len() == 0) { - // go straight to reading again. this was probably an async method + // go straight to reading again. this was probably an oneway method state_ = AWAITING_REGISTER_READ; buffer_ = null; } else { diff --git a/lib/java/test/org/apache/thrift/test/TestClient.java b/lib/java/test/org/apache/thrift/test/TestClient.java index d868999c..91b3ec59 100644 --- a/lib/java/test/org/apache/thrift/test/TestClient.java +++ b/lib/java/test/org/apache/thrift/test/TestClient.java @@ -353,7 +353,7 @@ public class TestClient { } System.out.print("}\n"); - // Test async + // Test oneway System.out.print("testAsync(3)..."); long startAsync = System.nanoTime(); testClient.testAsync(3); diff --git a/lib/py/src/server/TNonblockingServer.py b/lib/py/src/server/TNonblockingServer.py index a588fe34..816827cc 100644 --- a/lib/py/src/server/TNonblockingServer.py +++ b/lib/py/src/server/TNonblockingServer.py @@ -162,7 +162,7 @@ class Connection: self.len = '' self.message = struct.pack('!i', len(message)) + message if len(message) == 0: - # it was async request, do not write answer + # it was a oneway request, do not write answer self.status = WAIT_LEN else: self.status = SEND_ANSWER diff --git a/test/ThriftTest.thrift b/test/ThriftTest.thrift index e7152c40..c93fed58 100644 --- a/test/ThriftTest.thrift +++ b/test/ThriftTest.thrift @@ -102,7 +102,7 @@ service ThriftTest Xtruct testMultiException(string arg0, string arg1) throws(Xception err1, Xception2 err2) - /* Test async void */ + /* Test oneway void */ async void testAsync(1:i32 secondsToSleep) } diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp index 53502977..b12a4b56 100644 --- a/test/cpp/src/TestClient.cpp +++ b/test/cpp/src/TestClient.cpp @@ -420,7 +420,7 @@ int main(int argc, char** argv) { printf(" exception\nFAILURE\n"); } - /* test async void */ + /* test oneway void */ { printf("testClient.testAsync(3) =>"); uint64_t startAsync = now(); @@ -434,8 +434,8 @@ int main(int argc, char** argv) { } /** - * redo a simple test after the async to make sure we aren't "off by one" -- - * if the server treated async void like normal void, this next test will + * redo a simple test after the oneway to make sure we aren't "off by one" -- + * if the server treated oneway void like normal void, this next test will * fail since it will get the void confirmation rather than the correct * result. In this circumstance, the client will throw the exception: * diff --git a/test/erl/src/test_disklog.erl b/test/erl/src/test_disklog.erl index 81b7b50c..0cc03bc2 100644 --- a/test/erl/src/test_disklog.erl +++ b/test/erl/src/test_disklog.erl @@ -14,12 +14,12 @@ t() -> io:format("Client started~n"), - % We have to make async calls into this client only since otherwise it will try + % We have to make oneway calls into this client only since otherwise it will try % to read from the disklog and go boom. {ok, ok} = thrift_client:call(Client, testAsync, [16#deadbeef]), io:format("Call written~n"), - % Use the send_call method to write a non-async call into the log + % Use the send_call method to write a non-oneway call into the log ok = thrift_client:send_call(Client, testString, [<<"hello world">>]), io:format("Non-async call sent~n"), @@ -46,12 +46,12 @@ t_base64() -> io:format("Client started~n"), - % We have to make async calls into this client only since otherwise it will try + % We have to make oneway calls into this client only since otherwise it will try % to read from the disklog and go boom. {ok, ok} = thrift_client:call(Client, testAsync, [16#deadbeef]), io:format("Call written~n"), - % Use the send_call method to write a non-async call into the log + % Use the send_call method to write a non-oneway call into the log ok = thrift_client:send_call(Client, testString, [<<"hello world">>]), io:format("Non-async call sent~n"), diff --git a/tutorial/tutorial.thrift b/tutorial/tutorial.thrift index 17c58273..52e1b75b 100644 --- a/tutorial/tutorial.thrift +++ b/tutorial/tutorial.thrift @@ -117,8 +117,8 @@ service Calculator extends shared.SharedService { i32 calculate(1:i32 logid, 2:Work w) throws (1:InvalidOperation ouch), /** - * This method has an async modifier. That means the client only makes - * a request and does not listen for any response at all. Async methods + * This method has a oneway modifier. That means the client only makes + * a request and does not listen for any response at all. Oneway methods * must be void. */ async void zip()