The first part of your question is about the difference between
multicast() and
share(). It's helpful to understand that
share() is a more of a convenience, returning a
Publishers.Share instance that does three things for you.
It uses a Publishers.Multicast to ensure multicasting behavior (it's legal for a publisher to be unicast, meaning that adding a second subscriber discards the subscription from the first).
Because Publishers.Mutlicast is a ConnectablePublisher, meaning you have to call connect() to start producing elements, the Publishers.Share instance uses a Publishers.Autoconnect, so that it starts producing values after the first subscriber attaches.
To produce the elements, the Publishers.Share instance uses a PassthroughSubject. This is more convenient than a CurrentSubject in that it doesn't need to be initialized with an initial value.
So, instead of thinking of them as peers, think of
share() as building on
multicast().
As for why the
Publishers.Multicast needs a
Subject and not some other kind of publisher, notice that the signature of the
Subject protocol requires that its implementations conform to both
Publisher and AnyObject. That means that
Publishers.Multicast can assume reference semantics, and it can use
Subject.send(_:) to send the values it receives to its various downstream subscribers.