Handles completion and errors for callbacks, promises, observables and streams.