1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-24 22:23:15 +00:00

Update documentation for net/read and net/chunk.

This commit is contained in:
Calvin Rose 2020-04-27 19:25:28 -05:00
parent 6b0f93ce8a
commit c98e1f3cae

View File

@ -685,14 +685,14 @@ static const JanetReg net_cfuns[] = {
{
"net/read", cfun_stream_read,
JDOC("(net/read stream nbytes &opt buf)\n\n"
"Read n bytes from a stream, suspending the current fiber until the bytes are available. "
"Returns a buffer with n more bytes in it.")
"Read up to n bytes from a stream, suspending the current fiber until the bytes are available. "
"If less than n bytes are available (and more than 0), will push those bytes and return early. "
"Returns a buffer with up to n more bytes in it.")
},
{
"net/chunk", cfun_stream_chunk,
JDOC("(net/chunk stream nbytes &opt buf)\n\n"
"Same a net/read, but will return as soon as any data is available "
"rather than wait for all n bytes to arrive.")
"Same a net/read, but will wait for all n bytes to arrive rather than return early.")
},
{
"net/write", cfun_stream_write,