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(),
}
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;
- // Shortcut out here for async functions
+ // Shortcut out here for oneway functions
if (tfunction->is_oneway()) {
f_service_ <<
indent() << "return ()" << endl;
const std::vector<t_field*>& xceptions = xs->get_members();
vector<t_field*>::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;
f_service_ << endl;
}
- // Shortcut out here for async functions
+ // Shortcut out here for oneway functions
if (tfunction->is_oneway()) {
f_service_ <<
indent() << "return;" << endl;
const std::vector<t_field*>& xceptions = xs->get_members();
vector<t_field*>::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;
- // Shortcut out here for async functions
+ // Shortcut out here for oneway functions
if (tfunction->is_oneway()) {
f_service_ <<
indent() << "()" << endl;
const std::vector<t_field*>& xceptions = xs->get_members();
vector<t_field*>::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;
f_service_ << "}" << endl;
}
- // Shortcut out here for async functions
+ // Shortcut out here for oneway functions
if (tfunction->is_oneway()) {
f_service_ <<
indent() << "return;" << endl;
const std::vector<t_field*>& xceptions = xs->get_members();
vector<t_field*>::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;
f_service_ << "}" << endl;
}
- // Shortcut out here for async functions
+ // Shortcut out here for oneway functions
if (tfunction->is_oneway()) {
f_service_ <<
indent() << "return;" << endl;
const std::vector<t_field*>& xceptions = xs->get_members();
vector<t_field*>::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;
}
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;
}
}
- // Shortcut out here for async functions
+ // Shortcut out here for oneway functions
if (tfunction->is_oneway()) {
f_service_ <<
indent() << "return" << endl;
const std::vector<t_field*>& xceptions = xs->get_members();
vector<t_field*>::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;
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;
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;
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) ->
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.
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 {
}
System.out.print("}\n");
- // Test async
+ // Test oneway
System.out.print("testAsync(3)...");
long startAsync = System.nanoTime();
testClient.testAsync(3);
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
Xtruct testMultiException(string arg0, string arg1) throws(Xception err1, Xception2 err2)
- /* Test async void */
+ /* Test oneway void */
async void testAsync(1:i32 secondsToSleep)
}
printf(" exception\nFAILURE\n");
}
- /* test async void */
+ /* test oneway void */
{
printf("testClient.testAsync(3) =>");
uint64_t startAsync = now();
}
/**
- * 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:
*
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"),
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"),
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()