request() is thread-safe

It is typically used for receiving, but is on the sending object. It
would be a pain for users to coordinate, and the implementation is
already thread-safe because we always thought it would be thread-safe.
So make it part of the documentation.
This commit is contained in:
Eric Anderson 2015-09-11 16:36:38 -07:00
parent ff3dbf7b0a
commit f894339923
2 changed files with 4 additions and 0 deletions

View File

@ -140,6 +140,8 @@ public abstract class ClientCall<ReqT, RespT> {
* <p>If called multiple times, the number of messages able to delivered will be the sum of the
* calls.
*
* <p>This method is safe to call from multiple threads without external synchronizaton.
*
* @param numMessages the requested number of messages to be delivered to the listener. Must be
* non-negative.
*/

View File

@ -109,6 +109,8 @@ public abstract class ServerCall<RespT> {
*
* <p>Servers use this mechanism to provide back-pressure to the client for flow-control.
*
* <p>This method is safe to call from multiple threads without external synchronizaton.
*
* @param numMessages the requested number of messages to be delivered to the listener.
*/
public abstract void request(int numMessages);