[erlang-questions] Pipe Operator in Erlang?

Éric Pailleau eric.pailleau@REDACTED
Fri Jul 10 07:22:03 CEST 2015


Le 10 juil. 2015 01:18, Fred Hebert <mononcqc@REDACTED> a écrit :
>
> On 07/10, Éric Pailleau wrote: 
> >A = catch Pid |  {somemessage, somevalue }. 
> >This would probably need a timeout. On other hand,  ! + receive may wait forever. | could do the same. 
>
> A = [catch Pid | {somemessage, somevalue}]. 
>
> Is A equal to: 
>
> a) [Pid | {somemessage, somevalue}] (improper list) 
> b) [Result] (the received message) 
>
Yes, you are right. But I do not request that pipe must be the operator. If !! Is better, I do not care. The need is more important than the syntax itself. 


> It also ignores that two processes may have more than two communications 
> going on at the same time, and that without a selective receive, it's 
> not obvious that anything would match properly. 
I m not sure to understand there. We are talking about synchronous message. When using gen_server:call you do not receive answer to another request,  but yours.


More information about the erlang-questions mailing list