The consumer will typically convert incoming raw data in some way, and
pass it on to a another layer. For example, XML parsers implementing this
protocol usually parse the data stream into a stream of XML tokens (that
is, start tags, character data, end tags, etc).

Process incoming data. The data argument should be a byte string.
The application can call this method as many times as it wants (or not at
all, if the source is empty). The data buffer may contain zero or more
bytes of data.

close()

No more data available. The application should call this method
when it has reached the end of the source stream.

reset() (optional)

Reset the consumer. Note that this method isn’t part of the
core consumer protocol, and applications should be prepared to deal
with consumers that don’t provide this method.