title: How do I get the process id of the calling process in erlang?
body: <p>A took a look at <a href="http://erlang.org/doc/apps/inets/http_client.html" rel="nofollow noreferrer">http://erlang.org/doc/apps/inets/http_client.html</a> and found the following:</p>
  
  <blockquote>
  An ordinary asynchronous request. The result will be sent to the calling process on the form {http, {ReqestId, Result}}
  <pre><code>
        5 > {ok, RequestId} =
        http:request(get, {"http://www.erlang.org", []}, [], [{sync, false}]).
  </code></pre>
  
  In this case the calling process is the shell, so we receive the result.
  <pre><code>
        6 >  receive {http, {RequestId, Result}} -> ok after 500 -> error end.
        ok
  </code></pre>
  </blockquote>
  
  <p>http:request passes a message to me after calling it that way, but how does it know my process id? As far as I understand, http:request has to do "Pid ! {http, {RequestId, Result}" to send the result to me, but where does it know the value of Pid?</p>