rsocket-cpp icon indicating copy to clipboard operation
rsocket-cpp copied to clipboard

StreamCompletionSignal options should match spec

Open lexs opened this issue 7 years ago • 2 comments

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,
};

lexs avatar Oct 11 '16 14:10 lexs

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]

benjchristensen avatar May 26 '17 19:05 benjchristensen

Thus:

enum class StreamCompletionSignal {
  COMPLETE,
  APPLICATION_ERROR,
  REJECTED,
  CANCELED,
  INVALID,
};

benjchristensen avatar May 26 '17 19:05 benjchristensen