[RPC] Improve RPCServer AsyncIO support. (#5544)
authorTianqi Chen <tqchen@users.noreply.github.com>
Fri, 8 May 2020 22:55:22 +0000 (15:55 -0700)
committerGitHub <noreply@github.com>
Fri, 8 May 2020 22:55:22 +0000 (15:55 -0700)
commit2175f6be6d1fd414a14b73deb78808b80e2ba032
treed8f479dc1da46ac0ce7c70bf8808999b60488d18
parent15a421880f252b18d3636606234d8e20b91047f5
[RPC] Improve RPCServer AsyncIO support. (#5544)

* [RPC] Improve RPCServer AsyncIO support.

When the RPCServer is in the async IO mode, it is possible for the server
to directly serve async function that may return its value via a callback in the future.
This mode is particular useful to the web environment, where blocking is not an option.

This PR introduces the Async support to the RPCSession, allowing the AsyncIO driven servers
to serve the async functions. These functions will still be presented as synchronized version
on the client side.

Followup PR will refactor the web runtime to make use of this feature.

* Address comments
src/runtime/rpc/rpc_endpoint.cc
src/runtime/rpc/rpc_local_session.cc
src/runtime/rpc/rpc_local_session.h
src/runtime/rpc/rpc_session.cc
src/runtime/rpc/rpc_session.h