View Source pmap (util v1.3.4)

Parallel map and multicall.

Link to this section Summary

Functions

Send messages to pids and wait for replies. Each Pid would get a message in the form: {{FromPid, Ref}, Msg} and would have to reply with: FromPid ! {{self(), Ref}, Reply}. The function aggregates all replies into Success and Error lists. The error list is in the form: {Pid, ErrorReason}.

Evaluate the MultiArgs list by calling F on each argument in the list concurrently.

Evaluate the MultiArgs list by calling F on each argument in the list concurrently. Same as pmap/2 but has a Timeout option.

Send a reply back to sender.

Link to this section Functions

Link to this function

multicall(PidMsgs, Timeout)

View Source
-spec multicall([{pid(), term()}], Timeout :: timeout()) ->
             {[OkReply :: term()], [ErrorReply :: term()]}.

Send messages to pids and wait for replies. Each Pid would get a message in the form: {{FromPid, Ref}, Msg} and would have to reply with: FromPid ! {{self(), Ref}, Reply}. The function aggregates all replies into Success and Error lists. The error list is in the form: {Pid, ErrorReason}.

-spec pmap(fun(() -> term()), [Args :: term()]) -> [Reply :: term()].

Evaluate the MultiArgs list by calling F on each argument in the list concurrently.

See also: pmap/3.

-spec pmap(fun((term()) -> term()), Args :: [term()], integer() | infinity) -> [Reply :: term()].

Evaluate the MultiArgs list by calling F on each argument in the list concurrently. Same as pmap/2 but has a Timeout option.

-spec reply({pid(), reference()}, Reply :: term()) -> ok.

Send a reply back to sender.