gen_server partial replies

Vlad Dumitrescu vlad_dumitrescu@REDACTED
Fri Nov 21 09:27:04 CET 2003

I got an idea: would it be possible to add partial replies from a gen_server?
Would it be useful, or just too specialized?

What I mean by partial replies is something like this:

    call find_all_primes_less_than(1000000)

        {partial_reply, [1, 3, 5, 7]}
        {partial_reply, [1, 3, 5, 7, 9, ..., 131]}
        {partial_reply, [1, ..., 1003]}
        {reply, [1, ..., 999997]}

The effect would be that the partial reply would be added to previous ones,
until a full reply is received (containing the whole answer). This way lenghty
operations could be monitored, and there is backwards compatibility (older
clients just ignore partial replies).

It might also be possible to let the partial replies be chunks of the whole
answer, and the concatenation would take place at the receiver. This would lower
the traffic, but isn't backwards compatible.

What do you think?


More information about the erlang-questions mailing list