anchor.diff:              ok = gen_tcp:send(Upstream, Data)
       end,
       upstream_sender_loop(Upstream).
  -
  --spec maybe_setup_dumping(#state{}, term()) -> #state{}.
  -maybe_setup_dumping(State, Args) ->
  -    case os:getenv("MEMBASE_DUMP_TAP_STREAMS") of
  -        false ->
  -            State;
  -        _ ->
  -            try
  -                do_setup_dumping(State, Args)
  -            catch E:T ->
  -                    ?log_error("Tried to setup tap stream dumping and failed.~n~p~n", [{E,T,erlang:get_stacktrace()}]),
  -                    State
  -            end
  -    end.
  -
  -do_setup_dumping(State, Args) ->
  -    FileNamePrefix = lists:flatten(io_lib:format("tap_dump_~w_~w", [misc:time_to_epoch_ms_int(now()), erlang:phash2(self())])),
  -    {ok, InfoIO} = file:open(path_config:component_path(data, FileNamePrefix ++ ".info"), [binary, write, delayed_write]),
  -    io:format(InfoIO, "InitialState:~n~p~n~nTap Args:~n~p~n", [State, Args]),
  -    ok = file:close(InfoIO),
  -    {ok, DumpIO} = file:open(path_config:component_path(data, FileNamePrefix ++ ".data"), [binary, write, delayed_write]),
  -    State#state{dump_file = DumpIO}.
   
   terminate(_Reason, #state{upstream_sender=UpstreamSender} = State) ->
       timer:kill_after(?TERMINATE_TIMEOUT),
  
positive.code:       takeover_done=false
       },
      erlang:process_flag(trap_exit, true),
      gen_server:enter_loop(?MODULE, [], maybe_setup_dumping(State, Args)).
  
  upstream_sender_loop(Upstream) ->
      receive
  
negative.code:                 takeover :: boolean(),
                  takeover_done :: boolean(),
                  takeover_msgs_seen = 0 :: non_neg_integer(),
                  last_seen
                 }).
  
  %% external API
  