A brief rant on naming: Combine's "sink" operator

It’s a bit unfortunate that Combine mixed up some terms, but yeah Sink is „well known” for „end of stream” elements.

It is, in my opinion, simpler to understand if such names come in pairs, as then one explains it as: stream flows from source to sink. This is why in Akka Streams we designed it as three main types of operators by thr way: Sources (origin of stream / data, like a file array or timer) + Flows (anything in between, e.g. operators) + Sinks (terminal operators, like fold or „write to file” etc.)

This is another reason why, personally, I still think the „AsyncStream” which is under SE review right now should be renamed, as it is exactly a Source, and definitely not a middle piece, nor a terminal piece. We’ll see if others agree though.

11 Likes