A looked through http://erlang.org/doc/apps/inets/http_client.html and found the following:
Normal asynchronous request. The result will be sent to the calling process in the form {http, {ReqestId, Result}} 5 > {ok, RequestId} = http:request(get, {"http://www.erlang.org", []}, [], [{sync, false}]). In this case, the calling process is a shell, so we get the result. 6 > receive {http, {RequestId, Result}} -> ok after 500 -> error end. ok
5 > {ok, RequestId} = http:request(get, {"http://www.erlang.org", []}, [], [{sync, false}]).
6 > receive {http, {RequestId, Result}} -> ok after 500 -> error end. ok
http: request sends me a message after calling it this way, but how does it know my process id? As far as I understand, http: request should execute "Pid! {Http, {RequestId, Result}" to send the result to me, but where does it know the value of Pid?
#request {} ( httpc_internal.hrl), , . pid; .
http-, , handle_request, from self().
- Pid, ββ . -
Server ! {self(), arguments}
.
Source: https://habr.com/ru/post/1715245/More articles:Availability of a translation server over the network - c ++Exiting SSI HTML Out - escapingI get error 0x8badf00d in an application for iPhone and is not the usual suspect - objective-cRunning irb in emacs (via run-ruby) echos all i type - ruby ββ| fooobar.comCompare array in javascript - javascriptjavascript comparison array - javascriptVisual Studio Debugging Path - cC stackoverflow runtime - cData structure for cache design with efficient insertion, deletion, and extraction of the highest value - algorithmHow to add value of combobox element in string collection editor in c #? - c #All Articles