In the previous example, we used the SubmissionPublisher class, so we didn't implement the Flow.Publisher and the Flow.Subscription interfaces. If the functionality provided by the SubmissionPublisher doesn't fit our needs, we will have to implement our own publisher and subscription.
In this section, you will learn how to implement both interfaces to learn the specification of the reactive streams. We are going to implement a news system where each piece of news will be associated with a category. A subscriber will be subscribed to one or more categories and the publisher will only send a piece of news to each subscriber if it's subscribed to its category.