question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What's in a name? {Receive,Send}Channel

See original GitHub issue
fun idiomHasher() : ReceiveChannel<String> //=>

"Color me a nitpicker"
"A rose by any other moniker..."

So we receive data from a ReceiveChannel and send data to a SendChannel. Simple? Not really.

Even after some experience with channels, I’m struggling with the names. The train of thought is along these lines:

  • “I want to read from the channel; what was the name of the readable interface? er… hm… receive… oh yeah, ReceiveChannel”. Same with SendChannel.

  • Or more commonly, “I have a ReceiveChannel. So, is that something I receive from, or does it receive from me?”. Less so for SendChannel.

I guess the issue here is while Receive and Send are behaviors (and behaviors are decent way to name interfaces), they are not specific enough.

IMHO, names that less ambigious:

  • Readable{Sumethin'} tells me I can read from it vs. Writable{Sumthin'}. (NodeJS)

  • Output{YourFavoriteCommunicationOrificeHere} tells me I must read from it, and vice versa with Input{YFCOH} (DirectShow filters; yes I am dated).

Regarding whether {Receive,Send}Channel are channels, or something else: according to Merriam-Webster, a channel is –

a means of communication or expression: such as (1) : a path along which information (such as data or music) in the form of an electrical signal passes.

So it would seem that Channel<E> is appropriately named. However {Receive,Send}Channel are interfaces to Channel where data can hop on or off the channel and as such, they are not channels. Nautical terms that define such a concept include pier, dock, jetty, and port among others.

IMHO, {Receive,Send}Channel should be renamed to:

  • {Receive,Send}Port
  • Or better still {Output,Input}Port

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
fvascocommented, May 10, 2018

I reuse this thread for a personal observation: often permissions are readable, writable and so on, but a SendChannel is writable if it not isClosedForSend, and a ReceiveChannel is accessible if it not isClosedForReceive, so I often use this double negation in my code.

My suggestion is use the positive version, like isOpenForSend or isOpenForReceive, or something similar like canSend or canReceive.

2reactions
elizarovcommented, Feb 22, 2019

Closing this one. Will not fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's in a Name? - WDIY
On this episode of What's In a Name?, Mike Flynn takes another dive into Lehigh Valley history with an exploration of Emmaus, in...
Read more >
Re: [Seagull-users] Can seagull support multiple commands?
Only need to specify what needs to be parsed > --> > <avp name="Session-Id" value="dont_care" /> > </command> > - <!-- > Store...
Read more >
What's In A Name? on Apple Podcasts
Today's “What's In A Name?” is about a small but important creek and was submitted by listener Mitch Payton. Willeo Creek near Roswell...
Read more >
Seagull Error Unexpected (no scenario found) call with ...
</receive> <send channel="channel-1"> <command name="SAA"> .... </send> </traffic>. Seagull responds to the MAR received with an MAA.
Read more >
Atividade final de Coursera - Engenharia de Software I - 3
Only need to specify what needs to be parsed --> <avp name="Session-Id" value="dont_care"> </avp> </command> <!-- Store action is at the end of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found