trio icon indicating copy to clipboard operation
trio copied to clipboard

StapledStream is a weird name

Open jtrakk opened this issue 6 years ago • 6 comments

And in my mental picture of two streams, stapling them together chokes both of them off. Why not BidirectionalStream or TwoWayStream? BidiStream is also available, though I wouldn't personally advocate for an abbreviation.

jtrakk avatar Sep 18 '19 20:09 jtrakk

All Streams are bidirectional, by definition. And most Stream implementations get this automatically, e.g. a SocketStream wraps around a TCP socket, and TCP sockets are already bidirectional. The key thing for StapledStream isn't that it's bidirectional, but that it helps you in the situation where you've somehow ended up with two unidirectional streams and need to make the jump to bidirectional, so I think the name should emphasize that jump.

The name is a bit cutesy though, yeah. I dunno that like, GluedStream would be any better though :-). Any other ideas?

njsmith avatar Sep 18 '19 20:09 njsmith

Any other ideas?

  • DualStream
  • BidirectionalStream
  • BidiStream
  • TwoWayStream
  • DuplexStream
  • MergedStream
  • ParallelStream
  • imageStream

jtrakk avatar Sep 18 '19 21:09 jtrakk

Hmm. For some of those I wonder if people could misread them as referring to somehow merging together the contents of two streams. Like MergedStream might be:

image

But it could also be:

image

I don't think we need to move quickly here, especially with #1208 still under discussion, so I'm going to leave this open for now to collect any thoughts folks have. And I added the "potential API breaker" label, to make sure that we remember to make a decision before v1.0.

njsmith avatar Sep 18 '19 22:09 njsmith

I feel that all those alternatives are misleading and StapledStream matches more closely to what is being done there.

agronholm avatar Jul 31 '20 10:07 agronholm

I'll add another name just for fun: CompositeStream

parity3 avatar Jul 31 '20 18:07 parity3

as a newbie, I was looking for a way to route an output stream to an input stream, and I thought StapledStream would do that, since I assume it's a very common task, and I saw nothing else that looked close. But then I found out it doesn't do that

tapple avatar Dec 15 '23 19:12 tapple