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

HandlerCallback eventbase thread in CPP2 ThriftServer #54

Closed
varunsharmagit opened this issue Dec 4, 2014 · 3 comments
Closed

HandlerCallback eventbase thread in CPP2 ThriftServer #54

varunsharmagit opened this issue Dec 4, 2014 · 3 comments

Comments

@varunsharmagit
Copy link

When using the CPP2 ThriftServer, does the HandlerCallback run the exception() and result() calls in the correct eventbase thread (corresponding to socket) or does that need to be taken care of as well, in case we have a context switch.

Thanks !

@alandau
Copy link
Contributor

alandau commented Dec 4, 2014

By default they serialize in the current thread and send the raw bytes to the socket on the EB thread. This is all handled automatically, you just need to call result() or exception() directly in your handler.

@alandau alandau closed this as completed Dec 4, 2014
@varunsharmagit
Copy link
Author

Thanks, one other question I had was that for the AsyncClient - this does not seem to be the case, so the caller of the function needs to be aware of calling the thrift call with a runInEventBase() since the socket operations are performed inline. Are there any variants in the AsyncClient in CPP2 which do the runInEventBase trick for free ?

@alandau
Copy link
Contributor

alandau commented Dec 4, 2014

No, not that I'm aware of

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants