anchor.diff:                  #{<<"status">> := <<"error">>, <<"reason">> := _Reason} ->
                       {error, invalid_macaroon}
               end;
  +        {error, worker_died} ->
  +            gen_server:reply(From, {error, worker_died}),
  +            exit(self(), kill);
           {error, _} ->
               {error, invalid_macaroon}
       end.
   
   
  --spec p_submit_payload(SubmissionData, Secret, WorkerPort, Timeout) -> submit_payload_result()
  +-spec p_submit_payload(SubmissionData, Secret, WorkerPort, From, Timeout) -> submit_payload_result()
                                                       when SubmissionData :: payload_submission_data(),
                                                            Secret :: binary(),
                                                            WorkerPort :: port(),
  +                                                         From :: pid(),
                                                            Timeout :: integer().
  -p_submit_payload({LeaseToken, Payload, Digest, HeaderSize}, Secret, WorkerPort, Timeout) ->
  +p_submit_payload({LeaseToken, Payload, Digest, HeaderSize}, Secret, WorkerPort, From, Timeout) ->
       Req1 = jsx:encode(#{<<"token">> => LeaseToken, <<"secret">> => Secret}),
       p_write_request(WorkerPort, ?kCheckToken, Req1),
       case p_read_reply(WorkerPort, Timeout) of
  
positive.code:     gen_server:start_link(?MODULE, Args, []).
  
  
  -spec generate_token(KeyId, Path, MaxLeaseTime) -> {Token, Public, Secret}
                                                         when KeyId :: binary(),
                                                              Path :: binary(),
                                                              MaxLeaseTime :: integer(),
  
negative.code:     receive
          {Port, {exit_status, Status}} ->
              lager:error("Worker process at port ~p died with status: ~p", [Port, Status]),
              {error, worker_died};
          {Port, {data, <<Size:32/integer-signed-little,Msg/binary>>}} ->
              {ok, {Size, Msg}}
      after
  