aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2018-04-11 18:10:02 -0700
committerGravatar Muxi Yan <mxyan@google.com>2018-04-11 18:10:02 -0700
commitc92d90aba2bd1bd710830c781d1e1e4c8adea0ba (patch)
treedb1825d2676e0be8809918378ab2826c24d42f17 /src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m
parente433b56defb450f5815e973da8798512b99c9e51 (diff)
clang-format objective-c files
Diffstat (limited to 'src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m')
-rw-r--r--src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m58
1 files changed, 27 insertions, 31 deletions
diff --git a/src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m b/src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m
index f91d2a6b62..88780e39f0 100644
--- a/src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m
+++ b/src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m
@@ -20,9 +20,9 @@
#import <GRPCClient/GRPCCall.h>
#import <ProtoRPC/ProtoMethod.h>
+#import <RxLibrary/GRXBufferedPipe.h>
#import <RxLibrary/GRXWriter+Immediate.h>
#import <RxLibrary/GRXWriter+Transformations.h>
-#import <RxLibrary/GRXBufferedPipe.h>
#import "src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.h"
@@ -35,8 +35,7 @@ NSString *host = @"grpc-test.sandbox.googleapis.com";
- (void)viewDidLoad {
[super viewDidLoad];
- [GRPCConnectivityMonitor registerObserver:self
- selector:@selector(reachabilityChanged:)];
+ [GRPCConnectivityMonitor registerObserver:self selector:@selector(reachabilityChanged:)];
}
- (void)reachabilityChanged:(NSNotification *)note {
@@ -52,23 +51,21 @@ NSString *host = @"grpc-test.sandbox.googleapis.com";
GRPCProtoMethod *method = [[GRPCProtoMethod alloc] initWithPackage:@"grpc.testing"
service:@"TestService"
method:@"UnaryCall"];
- GRXWriter *loggingRequestWriter =
- [[GRXWriter writerWithValue:[NSData dataWithBytes:bytes length:sizeof(bytes)]]
- map:^id(id value) {
- NSLog(@"Sending request.");
- return value;
- }];
- GRPCCall *call = [[GRPCCall alloc] initWithHost:host
- path:method.HTTPPath
- requestsWriter:loggingRequestWriter];
-
- [call startWithWriteable:[GRXWriteable writeableWithEventHandler:^(BOOL done, id value,
- NSError *error) {
- if (!done) {
- return;
- }
- NSLog(@"Unary call finished with error: %@", error);
- }]];
+ GRXWriter *loggingRequestWriter = [[GRXWriter
+ writerWithValue:[NSData dataWithBytes:bytes length:sizeof(bytes)]] map:^id(id value) {
+ NSLog(@"Sending request.");
+ return value;
+ }];
+ GRPCCall *call =
+ [[GRPCCall alloc] initWithHost:host path:method.HTTPPath requestsWriter:loggingRequestWriter];
+
+ [call startWithWriteable:[GRXWriteable
+ writeableWithEventHandler:^(BOOL done, id value, NSError *error) {
+ if (!done) {
+ return;
+ }
+ NSLog(@"Unary call finished with error: %@", error);
+ }]];
}
- (IBAction)tapStreaming:(id)sender {
@@ -85,17 +82,16 @@ NSString *host = @"grpc-test.sandbox.googleapis.com";
[requestsBuffer writeValue:[NSData dataWithBytes:bytes length:sizeof(bytes)]];
- GRPCCall *call = [[GRPCCall alloc] initWithHost:host
- path:method.HTTPPath
- requestsWriter:requestsBuffer];
-
- [call startWithWriteable:[GRXWriteable writeableWithEventHandler:^(BOOL done, id value,
- NSError *error) {
- if (!done) {
- return;
- }
- NSLog(@"Streaming call finished with error: %@", error);
- }]];
+ GRPCCall *call =
+ [[GRPCCall alloc] initWithHost:host path:method.HTTPPath requestsWriter:requestsBuffer];
+
+ [call startWithWriteable:[GRXWriteable
+ writeableWithEventHandler:^(BOOL done, id value, NSError *error) {
+ if (!done) {
+ return;
+ }
+ NSLog(@"Streaming call finished with error: %@", error);
+ }]];
}
@end