aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compiler/objective_c_generator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/objective_c_generator.cc')
-rw-r--r--src/compiler/objective_c_generator.cc23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/compiler/objective_c_generator.cc b/src/compiler/objective_c_generator.cc
index b235911479..79a84b4a7a 100644
--- a/src/compiler/objective_c_generator.cc
+++ b/src/compiler/objective_c_generator.cc
@@ -68,18 +68,19 @@ void PrintMethodSignature(Printer *printer,
printer->Print(vars, "- ($return_type$)$method_name$With");
if (method->client_streaming()) {
- printer->Print("RequestsWriter:(id<GRXWriter>)request");
+ printer->Print("RequestsWriter:(id<GRXWriter>)requestWriter");
} else {
printer->Print(vars, "Request:($request_class$ *)request");
}
// TODO(jcanizales): Put this on a new line and align colons.
- // TODO(jcanizales): eventHandler for server streaming?
- printer->Print(" handler:(void(^)(");
if (method->server_streaming()) {
- printer->Print("BOOL done, ");
+ printer->Print(vars, " eventHandler:(void(^)(BOOL done, "
+ "$response_class$ *response, NSError *error))eventHandler");
+ } else {
+ printer->Print(vars, " handler:(void(^)($response_class$ *response, "
+ "NSError *error))handler");
}
- printer->Print(vars, "$response_class$ *response, NSError *error))handler");
}
void PrintSimpleSignature(Printer *printer,
@@ -125,11 +126,15 @@ void PrintSimpleImplementation(Printer *printer,
printer->Print("{\n");
printer->Print(vars, " [[self RPCTo$method_name$With");
if (method->client_streaming()) {
- printer->Print("RequestsWriter:request");
+ printer->Print("RequestsWriter:requestWriter");
} else {
printer->Print("Request:request");
}
- printer->Print(" handler:handler] start];\n");
+ if (method->server_streaming()) {
+ printer->Print(" eventHandler:eventHandler] start];\n");
+ } else {
+ printer->Print(" handler:handler] start];\n");
+ }
printer->Print("}\n");
}
@@ -141,7 +146,7 @@ void PrintAdvancedImplementation(Printer *printer,
printer->Print(" requestsWriter:");
if (method->client_streaming()) {
- printer->Print("request\n");
+ printer->Print("requestWriter\n");
} else {
printer->Print("[GRXWriter writerWithValue:request]\n");
}
@@ -150,7 +155,7 @@ void PrintAdvancedImplementation(Printer *printer,
printer->Print(" responsesWriteable:[GRXWriteable ");
if (method->server_streaming()) {
- printer->Print("writeableWithStreamHandler:handler]];\n");
+ printer->Print("writeableWithStreamHandler:eventHandler]];\n");
} else {
printer->Print("writeableWithSingleValueHandler:handler]];\n");
}