Set the callback function that is called whenever the state of the stream changes.
See Implementation
Set the callback function that is called whenever the state of the stream changes.