anchor.diff:          {error, Reason} ->
               {error, Reason}
       end.
  +
  +p_write_request(Port, Request, Msg) ->
  +    Size = size(Msg),
  +    Buffer = <<Request:32/integer-signed-little,Size:32/integer-signed-little,Msg/binary>>,
  +    Port ! {self(), {command, Buffer}}.
  +
  +p_read_reply(Port) ->
  +    receive
  +        {Port, {data, <<Size:32/integer-signed-little,Msg/binary>>}} ->
  +            {Size, Msg}
  +    end.
  
positive.code: %%--------------------------------------------------------------------
  terminate(Reason, State) ->
      #{worker := WorkerPort} = State,
      port_close(WorkerPort),
      lager:info("Terminating with reason: ~p", [Reason]),
      ok.
  
negative.code:                                                       nouse_stdio,
                                                        exit_status]),
  
      %% Send a kEcho request to the worker
      lager:info("Sending kEcho request to worker process."),
      p_write_request(WorkerPort, ?kEcho, <<"Ping">>),
      {Size, Msg} = p_read_reply(WorkerPort),
      lager:info("Received kEcho reply from worker: size: ~p, msg: ~p", [Size, Msg]),
      {ok, #{worker => WorkerPort}}.
  
  %%--------------------------------------------------------------------
  