Documentation ¶
Index ¶
- type Payload
- func (pp *Payload) Ack(sequence int) (int, bool)
- func (pp *Payload) Complete() bool
- func (pp *Payload) Events() []*core.EventDescriptor
- func (pp *Payload) HasAck() bool
- func (pp *Payload) Init()
- func (pp *Payload) ResetSequence()
- func (pp *Payload) Rollup() []*core.EventDescriptor
- func (pp *Payload) Size() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Payload ¶
type Payload struct { Nonce string Resending bool Element internallist.Element ResendElement internallist.Element // contains filtered or unexported fields }
Payload holds the data and acknowledged status of a spool of events and provides methods for processing acknowledgements so that a future resend of the payload does not resend acknowledged events
func NewPayload ¶
func NewPayload(events []*core.EventDescriptor) *Payload
NewPayload initialises a new payload structure from the given spool of events
func (*Payload) Ack ¶
Ack processes an acknowledgement sequence, marking events as sent and preventing resends from sending those events Returns the number of events acknowledged, with the second return value true if the payload is now completely acknowledged
func (*Payload) Complete ¶
Complete returns true if all events in this payload have been acknowledged
func (*Payload) Events ¶
func (pp *Payload) Events() []*core.EventDescriptor
Events returns the unacknowledged set of events in the payload
func (*Payload) Init ¶
func (pp *Payload) Init()
Init initialises the internallist elements and anything else requiring initialisation
func (*Payload) ResetSequence ¶
func (pp *Payload) ResetSequence()
ResetSequence makes the first unacknowledged event have a sequence ID of 1 This should be called before resending to ensure the ACK messages returned (which will use an ID of 1 for the first unacknowledged event) are understood correctly
func (*Payload) Rollup ¶
func (pp *Payload) Rollup() []*core.EventDescriptor
Rollup removes acknowledged events from the payload and returns them so they may be passed onto the Registrar