Documentation
¶
Index ¶
Constants ¶
const DefaultBuffer = 0
Variables ¶
var ( // DefaultSkipper skips empty messages. DefaultSkipper Skipper = &skipperImpl{} // DefaultProceeder proceeds only on non-empty messages. DefaultProceeder Proceeder = &proceederImpl{} )
Functions ¶
This section is empty.
Types ¶
type Proceeder ¶
Proceeder makes decision whether or not proceed with the response sequence. Decision is made late, after the message handler is invoked or skipped.
type RequestOption ¶
type RequestOption func(*requestParams)
func RequestContentEncoding ¶ added in v0.24.0
func RequestContentEncoding(e codec.ContentEncoding) RequestOption
RequestContentEncoding sets the compression algorithm for the request message.
func RequestContentType ¶
func RequestContentType(c codec.ContentType) RequestOption
func RequestHeader ¶
func RequestHeader(header peanats.Header) RequestOption
RequestHeader merges the provided headers with existing headers for the message. If the same header key exists, the new values are appended to the existing ones.
type Requester ¶
type Requester[RQ, RS any] interface { Request(context.Context, string, *RQ, ...RequestOption) (Response[RS], error) ResponseReceiver(context.Context, string, *RQ, ...ResponseReceiverOption) (ResponseReceiver[RS], error) }
type ResponseReceiver ¶
type ResponseReceiverOption ¶
type ResponseReceiverOption func(*responseReceiverParams)
func ResponseReceiverBuffer ¶
func ResponseReceiverBuffer(size uint) ResponseReceiverOption
ResponseReceiverBuffer sets the buffer size for the response receiver.
func ResponseReceiverProceeder ¶
func ResponseReceiverProceeder(p Proceeder) ResponseReceiverOption
ResponseReceiverProceeder sets the proceeder for the response sequence.
func ResponseReceiverRequestOptions ¶
func ResponseReceiverRequestOptions(opts ...RequestOption) ResponseReceiverOption
ResponseReceiverRequestOptions appends the set of request options for the request produced by the response receiver.
func ResponseReceiverSkipper ¶
func ResponseReceiverSkipper(s Skipper) ResponseReceiverOption
ResponseReceiverSkipper sets the skipper for the response sequence.