rsocket-cpp
rsocket-cpp copied to clipboard
StreamCompletionSignal options should match spec
Filing so I don't forget.
We never use other values than GRACEFUL
and ERROR
from StreamCompletionSignal
.
There is an assert here that can never trigger because of this: https://github.com/ReactiveSocket/reactivesocket-cpp/blob/master/src/ConnectionAutomaton.cpp#L105
For reference the current values of the enum are:
enum class StreamCompletionSignal {
GRACEFUL,
ERROR,
INVALID_SETUP,
UNSUPPORTED_SETUP,
REJECTED_SETUP,
CONNECTION_ERROR,
CONNECTION_END,
};
A stream can be terminated in these ways:
- closed (normal successful termination)
- APPLICATION_ERROR (normal application failure termination)
- REJECTED
- CANCELED (unlikely that we'll use this)
- INVALID
See https://github.com/rsocket/rsocket/blob/master/Protocol.md#error-codes for the error types and descriptions. See https://github.com/rsocket/rsocket/blob/master/Protocol.md#stream-sequences-and-lifetimes for each stream type and possible terminations. For example:
- PAYLOAD with COMPLETE
- ERROR[APPLICATION_ERROR|REJECTED|CANCELED|INVALID]
Thus:
enum class StreamCompletionSignal {
COMPLETE,
APPLICATION_ERROR,
REJECTED,
CANCELED,
INVALID,
};