[erlang-questions] Re: Need parallel calls to gen_server:call, similar but different to gen_server:multi_call

Cameron Kerr ckerr@REDACTED
Thu Oct 1 03:01:24 CEST 2009


No, I need something that runs in parallel.

I've found rpc:pmap, and am currently trying to adapt it to my needs.

Thanks.

Steve Davis wrote:
> ...and the following is not appropriate to your needs?
>
> Responses = [gen_server:call(Pid,Request) || Pid <- PidList]
>
> /s
>
> On Sep 30, 5:36 pm, Cameron Kerr <ck...@REDACTED> wrote:
>   
>> Hello, I'm working on a project and have a need to send a
>> gen_server:call to multiple gen_servers in parallel.
>>
>> I've looked at gen_server:multi_call, but if I understand it correctly,
>> it is for working with multiple nodes, not multiple processes on the
>> same node. I have a list of gen_server PIDs, so would like something
>> that looks like:
>>
>> gen_server:parallel_call(Pid_list, Request) -> [Response]
>>
>> Is there something like this? If not, perhaps I could just send the
>> response using the '!' operator and process it using gen_server's
>> handle_info, then manually receive any responses... but this seems messy.
>>
>> Many thanks,
>> Cameron Kerr
>>
>> ________________________________________________________________
>> erlang-questions mailing list. Seehttp://www.erlang.org/faq.html
>> erlang-questions (at) erlang.org
>>     
>
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
>
>
>   




More information about the erlang-questions mailing list