| 1 |
Ordering Status and Reads in the gRPC API |
| 2 |
----------------------------------------- |
| 3 |
|
| 4 |
Rules for implementors: |
| 5 |
1. Reads and Writes Must not succeed after Status has been delivered. |
| 6 |
2. Status is only delivered after all buffered messages are read. |
| 7 |
3. Reads May continue to succeed after a failing write. |
| 8 |
However, once a write fails, all subsequent writes Must fail, |
| 9 |
and similarly, once a read fails, all subsequent reads Must fail. |
| 10 |
4. A non-OK status received from the server is not considered an error status. |
| 11 |
5. When an error status is known to the library, if the user asks for status, |
| 12 |
the library Should discard messages received in the library but not delivered |
| 13 |
to the user and then deliver the status. If the user does not ask for status |
| 14 |
but continues reading, the library Should deliver buffered messages before |
| 15 |
delivering status. The library MAY choose to implement the stricter version |
| 16 |
where errors cause all buffered messages to be dropped, but this is not a |
| 17 |
requirement. |