anchor.diff:      loop(State).
   
   -spec system_terminate(any(), _, _, _) -> no_return().
  -system_terminate(Reason, _, _, #state{ref=StreamRef}) ->
  +system_terminate(Reason, _, _, #state{ref=StreamRef,
  +                                      client_ref=ClientRef}) ->
  +    hackney:close(ClientRef),
       %% unregister the stream
       catch ets:delete(couchbeam_view_streams, StreamRef),
       exit(Reason).
  
positive.code:     receive
          {'DOWN', MRef, _, _, _} ->
              %% parent exited there is no need to continue
              exit(normal);
          {Ref, cancel} ->
              maybe_close(State),
  
negative.code:     receive
          {'DOWN', MRef, _, _, _} ->
              %% parent exited there is no need to continue
              maybe_close(State),
              exit(normal);
          {Ref, stream_next} ->
              loop(State);
  