Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloserStream ¶
type CloserStream interface { IncomingMessages() (<-chan rpc.IncomingMessage, error) WriteMessage(body []byte, bodyType transport.MessageBodyType) error CloseWithError(err error) error }
type Handler ¶
type Handler interface { // Procedure returns a specification of the procedure handled by this // handler. Mux routes requests bases on this value. Procedure() rpc.Procedure // Handle should perform actions requested by the provided request and // return responses using the provided response writer. The handler returns // errors to make the flow of control within the handler easier to follow. // If an error is returned it will be sent over the RPC connection, // otherwise the connection is terminated cleanly. Handle is executed in a // separate goroutine and can therefore block and process the request for as // long as it needs. Handle(ctx context.Context, s Stream, req *rpc.Request) error }
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
func (Mux) HandleRequest ¶
type Stream ¶
type Stream interface { IncomingMessages() (<-chan rpc.IncomingMessage, error) WriteMessage(body []byte, bodyType transport.MessageBodyType) error }
type SynchronousHandler ¶
type SynchronousHandler interface { // Procedure returns a specification of the procedure handled by this // handler. Mux routes requests bases on this value. Procedure() rpc.Procedure // Handle should perform actions requested by the provided request and // return responses using the provided response writer. Handler must close // the response writer. Handle isn't processed in a separate goroutine and // should avoid blocking. This is useful when there is a need to offload the // work to a set of workers without spawning extra goroutines to limit // pressure on the scheduler and garbage collector. This is useful in the // case of create history stream requests which are performed in very large // amounts when connecting to large pubs. Handle(ctx context.Context, s CloserStream, req *rpc.Request) }
Click to show internal directories.
Click to hide internal directories.