Skip to content
Snippets Groups Projects
Commit d5c1b56d authored by Jorge Canizales's avatar Jorge Canizales
Browse files

Adds sample usage code of GRPCClient

It doesn’t build yet, because it’s missing a podspec for the C library.
That’s the next thing I’m working on.
parent e379e5c1
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,10 @@
*/
#import "ViewController.h"
#import <GRPCClient/GRPCCall.h>
#import <GRPCClient/GRPCMethodName.h>
#import <RxLibrary/GRXWriter+Immediate.h>
#import <RxLibrary/GRXWriteable.h>
@interface ViewController ()
......@@ -42,6 +46,20 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:@"grpc.testing"
interface:@"TestService"
method:@"EmptyCall"];
GRPCCall *call = [[GRPCCall alloc] initWithHost:@"localhost"
method:method
requestsWriter:[GRXWriter writerWithValue:[NSData data]]];
[call startWithWriteable:[[GRXWriteable alloc] initWithValueHandler:^(NSData *value) {
NSLog(@"Received response: %@", value);
} completionHandler:^(NSError *errorOrNil) {
NSLog(@"Finished with error: %@", errorOrNil);
}]];
}
- (void)didReceiveMemoryWarning {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment