gen_server:cast/2 vs !

Valentin valentin@REDACTED
Sat Oct 4 10:01:09 CEST 2003


> 
> How would it behave differently if you coded it as:
> 
> -module(my_server).
> -export([send_async_req/2).
> 
> send_async_req(Pid, Req) ->
>      Pid ! Req.
> 

How about this:

The server side, construct like

    handle_cast( {some_pattern, A, B, C}, State ) ->  ......

would handle both client requests:

    cast( ServerRef, Request )

as well as

    abcast( ServerName, Request )


This worked for me nicely in quite a few occasions.

V.






More information about the erlang-questions mailing list