Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make thrift cocoa lib support TMultiplexedProtocol #150

Closed
wants to merge 1 commit into from

Conversation

guoyalun
Copy link

@guoyalun guoyalun commented Jul 3, 2014

make thrift cocoa lib support TMultiplexedProtocol , so that thrift support mutil service .

@Jens-G
Copy link
Member

Jens-G commented Jul 3, 2014

Hi guoyalun ,
that's great!

Could you just file a JIRA ticket and reference it here?
http://thrift.apache.org/docs/HowToContribute

Thanks!
JensG

@drobakowski
Copy link
Contributor

Hi @guoyalun,

before you create a new JIRA ticket, i think this duplicates my ticket THRIFT-2144 as well as parts of the unmerged PR #49. I'm currently rebasing my closed and unmerged PRs.

Greets,
David

@Jens-G
Copy link
Member

Jens-G commented Jul 3, 2014

Hi @guoyalun and @drobakowski,

I'd really like you both to agree upon one patch set, which will finally be committed to the Thrift code base. That way we could involve more knowledgeable eyes to look out for problems.

@drobakowski
Copy link
Contributor

Hi @Jens-G,

absolutely, whatever it takes to get one or the other patch committed! :) I will try to show the main differences from my point of view.

  • ARC:
    • My patch is backward compatible with non ARC Objective-C code and uses the retain_stub/dealloc_stub/release_stub/autorelease_stub functions for dealing with memory allocs etc.
    • @guoyalun version is not.
  • In writeMessageBeginWithName:
switch (messageType) {
    case TMessageType_CALL:
    case TMessageType_ONEWAY:
…

vs.

if (messageType == TMessageType_CALL || messageType == TMessageType_ONEWAY) {
…

where i prefer my switch statement because it's a direct jump at runtime.

NSMutableString * serviceFunction = [[NSMutableString alloc] initWithString:mServiceName];
[serviceFunction appendString:MULTIPLEXED_SERVICE_SEPERATOR];
[serviceFunction appendString:name];
…

vs.

NSString *messageName = [NSString stringWithFormat:@"%@%@%@",_serviceName,SEPARATOR,name];

I’m not sure which one is better and should be used according to memory/performance usage. According to memory usage, I think I've read somewhere that NSMutableString should perform better in this case but I don't have enough experience with Objective-C, @Jens-G, @guoyalun do you have some advice? Sure @guoyalun version looks cleaner.

@guoyalun did I miss something, whats your opinion to the differences?

@@ -0,0 +1,19 @@
//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add apache license header

@asfgit asfgit closed this in aa99e0e Sep 29, 2014
stigsb pushed a commit to stigsb/thrift that referenced this pull request Nov 3, 2014
…sport and Protocol

Client: Cocoa
Patch: David Robakowski

This closes apache#151
This closes apache#150
allengeorge pushed a commit to allengeorge/thrift that referenced this pull request Jan 1, 2017
…sport and Protocol

Client: Cocoa
Patch: David Robakowski

This closes apache#151
This closes apache#150
ringsheep pushed a commit to ringsheep/thrift that referenced this pull request Mar 5, 2017
…sport and Protocol

Client: Cocoa
Patch: David Robakowski

This closes apache#151
This closes apache#150
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants