Std.Db.Session.nextMessage
1 declaration
fn
nextMessage: Std.Db.Session.Connection -> Result[(Std.Db.Protocol.Message, Std.Db.Session.Connection), Std.Db.Session.DbError]This is a callable function.
What it does
Read the next message, taking more from the socket only when what has
arrived does not already hold one.
Reading a message at a time from the socket directly would ask for its five
byte head and then its body as two reads, and a server is free to send
several messages in one packet. Buffering is what makes the reader agree
with what the server actually sends rather than with how it was drawn.
Read the signature
- The text after the name is the type checked by Pudu.
- Read arrows from left to right: inputs come first, and the final type is returned.
- Names inside [ ] are type arguments, such as the item type held by a collection.
- Result makes success and recoverable failure part of the function's type.
