publisher

package
v0.37.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressFilter

type AddressFilter func(address string) bool

return false if the provided address is to be filtered out

type Publisher

type Publisher[T peer.ServiceClient, RequestData any] struct {
	// contains filtered or unexported fields
}

func NewPublisher

func NewPublisher[T peer.ServiceClient, RequestData any](
	logger golog.Logger,
	peerPool peer.PeerPool[T],
	send SendFn[T, RequestData],
) *Publisher[T, RequestData]

func (*Publisher[T, RequestData]) TrySendToClient

func (p *Publisher[T, RequestData]) TrySendToClient(
	data RequestData,
	address string,
	client T,
	numberOfRetry int,
) *Response

trySendToClient returns true if the client acknowledged the request

type Response

type Response struct {
	// contains filtered or unexported fields
}

func NewResponse

func NewResponse(ack bool, requestedNodeUnavailable bool) *Response

func (*Response) IsAcknowledged

func (r *Response) IsAcknowledged() bool

func (*Response) IsRequestedNodeUnavailable

func (r *Response) IsRequestedNodeUnavailable() bool

type SendCallback

type SendCallback func(address string, response *Response)

type SendFn

type SendFn[T peer.ServiceClient, RequestData any] func(ctx context.Context, data RequestData, client T) (*SendResponse, error)

type SendResponse

type SendResponse struct {
	Ack    bool
	Reason *string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL