Skip to content

New Core API#381

Merged
yang-g merged 40 commits intogrpc:masterfrom
ctiller:async-api-new
Feb 9, 2015
Merged

New Core API#381
yang-g merged 40 commits intogrpc:masterfrom
ctiller:async-api-new

Conversation

@ctiller
Copy link
Copy Markdown
Member

@ctiller ctiller commented Feb 4, 2015

Please don't merge this until #357 is done.

I'm publishing this now because:

  • the first test passes
  • people have been curious

Once #357 is in, let's get this reviewed. I'll be working on getting all the tests converted, but I don't think we should gate on that, since C++ API's will also need to be updated.

@ctiller
Copy link
Copy Markdown
Member Author

ctiller commented Feb 4, 2015

@a11r @tbetbetbe @murgatroid99 @nathanielmanistaatgoogle @jcanizales @jtattermusch

Getting some initial review on API changes in grpc.h (with a demonstration in simple_request.c) would be great at this point, before this work gets too much further.

@ctiller
Copy link
Copy Markdown
Member Author

ctiller commented Feb 4, 2015

Also... if anyone wants to start working on this stuff... feel free to branch from this. I'll happily take pull requests on top of it up until it's time to merge it all in (although I hope there's not too much delay on that).

@jcanizales
Copy link
Copy Markdown
Contributor

From what I see, grpc.h only has additions, so the change is backward-compatible. Correct?

@ctiller
Copy link
Copy Markdown
Member Author

ctiller commented Feb 4, 2015

The plan is to delete anything suffixed with _old at some point in the
not-distant future.

On Tue Feb 03 2015 at 10:00:46 PM Jorge Canizales notifications@github.com
wrote:

From what I see, grpc.h only has additions, so the change is
backward-compatible. Correct?


Reply to this email directly or view it on GitHub
#381 (comment).

@murgatroid99
Copy link
Copy Markdown
Member

The meeting yesterday seemed to indicate that there would be a new completion type, which makes sense because grpc_event seems to have a lot of redundancy with grpc_op. What's the deal with that?

@ctiller
Copy link
Copy Markdown
Member Author

ctiller commented Feb 4, 2015

So the rough story for grpc_event:

Whilst we need to keep the current core API's alive, we are stuck with a big ugly grpc_event struct.

When we go and delete all _old functions, we can also cleanup grpc_event (and do a minor round of edits to wrappers for compatibility)... I expect that it will end up looking like:

struct grpc_event {
void *tag;
grpc_call *call;
grpc_op_error op_successful;
};

@murgatroid99
Copy link
Copy Markdown
Member

So, when using the new APIs, should I just use those fields? Also, if event will still have a call*, why does grpc_server_request_call need a call**?

@ctiller
Copy link
Copy Markdown
Member Author

ctiller commented Feb 4, 2015

You should... for now you'll get a completion of type
GRPC_OP_COMPLETE for any of the new API's... and the accessible fields then
are exactly the ones I described that we'll be moving to.

On Wed Feb 04 2015 at 9:44:25 AM Michael Lumish notifications@github.com
wrote:

So, when using the new APIs, should I just use those fields? Also, if
event will still have a call_, why does grpc_server_request_call need a
call_*?


Reply to this email directly or view it on GitHub
#381 (comment).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does the order of ops matter?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No.

@ctiller
Copy link
Copy Markdown
Member Author

ctiller commented Feb 5, 2015

Tests are still coming... I'll try to get the bulk of them tomorrow. It'd be good to get this in regardless though.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is the use of these functions?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Principally helpers to get things set-up/torn-down in the right way. Their use is optional.

@ctiller
Copy link
Copy Markdown
Member Author

ctiller commented Feb 6, 2015

Added more tests and stabilized a bunch

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we log something like the status code here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Maybe, once #257 gets fixed up.

@ctiller
Copy link
Copy Markdown
Member Author

ctiller commented Feb 6, 2015

Updated to address comments.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

duplicate line 35?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed.

yang-g added a commit that referenced this pull request Feb 9, 2015
@yang-g yang-g merged commit ee8f51f into grpc:master Feb 9, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Feb 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants