[ https://issues.apache.org/jira/browse/THRIFT-3041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14368469#comment-14368469 ]
Mike Riley commented on THRIFT-3041: ------------------------------------ The formatting problems I was seeing are due to some existing problems with the indentation logic in the Cocoa generator. I moved some things around to generate correct indentation for the new async clients, and preserve the old indentation of the existing clients. I have sample diffs of generated sources here if you want to see: https://github.com/yelirekim/thrift-cocoa-love/tree/0419ccc1c778916d8eae6e3603bb3f22f8c12423/gen-cocoa/diff *.diff show the difference between what the compiler originally would have generated, and the new sources with async clients included *.diff.no_clients show differences between the newly generated sources without clients, and newly generated sources with clients *.diff.orig.no_clients show differences between original sources without clients, and new sources without clients (this represents the differences that would manifest in existing codebases which regenerate using the new compiler) > Generate asynchronous clients for Cocoa > --------------------------------------- > > Key: THRIFT-3041 > URL: https://issues.apache.org/jira/browse/THRIFT-3041 > Project: Thrift > Issue Type: Improvement > Components: Cocoa - Compiler, Cocoa - Library > Reporter: Mike Riley > Fix For: 0.9.3 > > Attachments: async-clients.diff > > > I've been using thrift on a decent variety of iOS projects for the last ~4 > years. Every time I set a new project up, I invariably end up inventing some > way to invoke thrift RPC calls via Objective-C block syntax. I usually end > up ripping apart the generated classes by declaring their private methods, > and then writing a bunch of boilerplate all so that I can avoid using the > provided HTTP client, which makes synchronous requests. > This is a decent stab at letting the generator take care of this problem for > me, and everyone else. It ended up being pretty heavy handed with > t_cocoa_generator.cc, but I've spent a while testing this and am pretty > confident I managed to avoid breaking anything. I realize this is a large > change, so I've put up the sandbox I was using to test on github if that > makes it easier to review. If you want the tl;dr; about what practical > changes this has on generated sources: > https://github.com/yelirekim/thrift-cocoa-love/blob/master/thrift-cocoa-love/ViewController.m > https://github.com/yelirekim/thrift-cocoa-love/blob/master/gen-cocoa/asdf.h > I'd welcome feedback or proposed modifications if this approach isn't quite > right. -- This message was sent by Atlassian JIRA (v6.3.4#6332)