[erlang-questions] Jinterface receiveRPC bug?

David Welton davidnwelton@REDACTED
Tue May 20 11:40:57 CEST 2014


Hi,

> So it receives whatever message is in the queue and if it's looking like a
> 'rex' response, it retruns the value; otherwise it returns null.

Yes, we had just dug that out ourselves: if another message turns up,
it blows up.

> So yes,
> sometimes the returned value may be null. I usually create a mailbox for
> each rex request sent - that way it can only receive one message.

Ok, we'll look into that.  Thank you!  The "obvious" thing from an
Erlang point of view would be a selective receive, but I don't really
see that in a quick glance at the docs, and if you're suggesting
mailboxes, I take it that's the best way.

> The method doesn't even check that the first element is the atom 'rex',
> which can result in other kind of errors. This I would categorize as a bug.

Indeed.  This method should have a warning that there's a very real
risk that it will consume other messages and just return a null.

Thanks
-- 
David N. Welton

http://www.welton.it/davidw/

http://www.dedasys.com/



More information about the erlang-questions mailing list