Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultRetryInterval defines the Default Retry Interval of the message requester. DefaultRetryInterval = 10 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Events ¶
type Events struct {
// Fired when a request for a given message should be sent.
SendRequest *events.Event
// MissingMessageAppeared is triggered when a message is actually present in the node's db although it was still being requested.
MissingMessageAppeared *events.Event
}
Events represents events happening on a message requester.
type MessageExistsFunc ¶ added in v0.2.2
MessageExistsFunc is a function that tells if a message exists.
type MessageRequester ¶
type MessageRequester struct {
Events Events
// contains filtered or unexported fields
}
MessageRequester takes care of requesting messages.
func New ¶
func New(messageExists MessageExistsFunc, missingMessages []message.ID, optionalOptions ...Option) *MessageRequester
New creates a new message requester.
func (*MessageRequester) RequestQueueSize ¶ added in v0.2.2
func (requester *MessageRequester) RequestQueueSize() int
RequestQueueSize returns the number of scheduled message requests.
func (*MessageRequester) StartRequest ¶ added in v0.2.2
func (requester *MessageRequester) StartRequest(id message.ID)
StartRequest initiates a regular triggering of the StartRequest event until it has been stopped using StopRequest.
func (*MessageRequester) StopRequest ¶
func (requester *MessageRequester) StopRequest(id message.ID)
StopRequest stops requests for the given message to further happen.
type Option ¶
type Option func(*Options)
Option is a function which inits an option.
func RetryInterval ¶
RetryInterval creates an option which sets the retry interval to the given value.
Click to show internal directories.
Click to hide internal directories.