Skip to content

Clarifying EmbeddedChannel#writeOneOutbound versus EmbeddedChannel#write[AndFlush] #13822

Answered by jchambers
jchambers asked this question in Q&A
Discussion options

You must be logged in to vote

Now, I'm sure I can dig into the code and figure out what's different between these cases, but I'm less confident that I'll be able to understand the design intent.

I really should have just dug into the source code 🤦‍♂️

The intent is clear: the writeOne{Inbound|Outbound} methods:

  • Check that the channel is open, recording an exception if not
  • Perform the read/write if the channel is open
  • Mark the returned future failed with any previously-recorded exception; otherwise, mark it as succeeded

I will open a pull request to note these behaviors in the docs.

That said: it does seem a little weird to me that the future returned by writeOneOutbound is all but guaranteed to fail on await/sync. …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jchambers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant