Implementing the output sink worker

Of course, our pipeline would not be complete without an output sink! After all, payloads that travel through the pipeline do not disappear into thin air once they clear the pipeline; they must end up somewhere. So, together with an input source, users are expected to provide an output sink that implements the Sink interface:

In order to deliver processed payloads to the sink, the pipeline package will spawn a new goroutine and execute the sinkWorker function, whose implementation is as follows:

Get Hands-On Software Engineering with Golang now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.