
From: "Jonathan Turkanis" <technews@kangaroologic.com>
Caleb Epstein wrote:
On Mon, 7 Mar 2005 20:29:17 -0700, Jonathan Turkanis <technews@kangaroologic.com> > Here are the names I've thought of:
good: good, is_good eof: eof, is_eof fail: fail, eagain, is_eagain, would_block, should_retry
I like "good" and "eof" as they are familiar from "native" iostreams and seem to map well to the asynchronous case. I think fail is perhaps too strong in this context however, and eagain is too "unix-y". My preference for this property would be "would_block".
Thanks for your feedback. would_block is unix-y too, no?
I don't see how "would_block" can be construed as "unix-y" since it merely indicates that the requested operation would have blocked had it not returned that value. As for the rest of the choices, I agree that you should keep "good" and "eof," "fail" is awfully general, and I don't think it is the called function's place to tell the caller to try again (eliminating eagain, is_eagain, and should_retry). Thus, from the given choices, I favor "would_block." If you want it to read better in the source, you could make it, "would_have_blocked:" if (read(...) == would_have_blocked) Other options would be: unavailable if (read(...) == unavailable) not_now if (read(...) == not_now) nothing_now if (read(...) == nothing_now) maybe_later if (read(...) == maybe_later) Still, "would_block" seems like the right choice: if (read(...) == would_block) -- Rob Stewart stewart@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;