[erlang-questions] Reinserting a message into a gen_server's mailbox

Ryan Zezeski rzezeski@REDACTED
Wed Aug 11 14:45:56 CEST 2010


On Wed, Aug 11, 2010 at 5:29 AM, Ulf Wiger
<ulf.wiger@REDACTED>wrote:
>
>
> I agree, and in my experience, this extra layer is often made
> necessary by the simple fact that you cannot use complex terms
> as locally registered names. Thus, you end up having to 'index'
> the workers somehow.
>
> Providing a generic solution to this was the main driving force
> behind gproc (http://github.com/esl/gproc).
>
> If a dispatching server ends up only looking at a request and
> forwarding it to the right server, it may well be that the
> processes doing the actual work could simply register themselves
> appropriately in gproc and eliminate the dispatcher altogether.
>

Ulf, gproc looks like it could be used for my many redundant requests/only
do the work once problem?   As long as I can normalize the request to some
type of term to act as an identifier I would be able to discern if work was
already being done for that request and if so I could use it to satisfy
multiple clients?  This is a little more transient than "looking at a
request and forwarding it to the right server" as these are short lived
"servers" but it seems to be the same idea, no?


More information about the erlang-questions mailing list