Documentation
¶
Overview ¶
from net/textproto
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
A Pipeline manages a pipelined in-order request/response sequence.
To use a Pipeline p to manage multiple clients on a connection, each client should run:
id := p.Next() // take a number p.StartRequest(id) // wait for turn to send request «send request» p.EndRequest(id) // notify Pipeline that request is sent p.StartResponse(id) // wait for turn to read response «read response» p.EndResponse(id) // notify Pipeline that response is read
A pipelined server can use the same calls to ensure that responses computed in parallel are written in the correct order.
func (*Pipeline) EndRequest ¶
EndRequest notifies p that the request with the given id has been sent (or, if this is a server, received).
func (*Pipeline) EndResponse ¶
EndResponse notifies p that the response with the given id has been received (or, if this is a server, sent).
func (*Pipeline) StartRequest ¶
StartRequest blocks until it is time to send (or, if this is a server, receive) the request with the given id.
func (*Pipeline) StartResponse ¶
StartResponse blocks until it is time to receive (or, if this is a server, send) the request with the given id.