Re: [PATCH 01/10] strbuf: Add strbuf_read_noblock
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 17, 2015, 17:57 UTC
- Message-ID
- <xmqqk2rphqsd.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20150917173536.GA28987@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 8 quoted lines
> I actually wonder if callers who are _expecting_ non-blocking want to > loop in strbuf_read() at all. > > strbuf_read() is really about reading to EOF, and growing the buffer to > fit all of the input. But that's not at all what you want to do with > non-blocking. There you believe for some reason that data may be > available (probably due to poll), and you want to read one chunk of it, > maybe act, and then go back to polling.
I think I could have gone to grab a cup of coffee instead of typing another message that essentially said the same thing ;-)