Created
June 8, 2010 21:42
-
-
Save pieceable/430695 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)addSomeNumbers | |
{ | |
var num1 = 1; | |
var num2 = 2; | |
[[self thriftClient] addWithNum1:num1 | |
num2:num2 | |
target:self | |
successAction:@selector(thriftClient:addSucceeded:) | |
failureAction:@selector(thriftClient:addFailed:)]; | |
} | |
- (void)thriftClient:(CalculatorClient)thriftClient addSucceeded:(int)sum | |
{ | |
CPLog.info("Added succeeded with sum: " + sum); | |
} | |
- (void)thriftClient:(CalculatorClient)thriftClient addFailed:(id)error | |
{ | |
CPLog.info("Added failed with error: " + error); | |
} | |
- (id)thriftClient | |
{ | |
var transport = [[THTTPTransport alloc] initWithURL:"http://localhost:4567/thrift"]; | |
var protocol = [[TBinaryProtocol alloc] initWithTransport:transport]; | |
var client = [[CalculatorClient alloc] initWithProtocol:protocol]; | |
return client; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment