Skip to content

Commit

Permalink
TxAlgorithm improvements. (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelquigley committed Aug 25, 2021
1 parent 496f873 commit d969096
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
28 changes: 28 additions & 0 deletions algorithm.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,47 @@ import "time"
// instance.
//
type TxAlgorithm interface {
// Tx will block the caller until there is sufficient space on the wire to enqueue the message.
//
Tx(int)

// Success will unblock Tx callers by freeing up space on the wire from a successfully received message.
//
Success(int)

// DuplicateAck is a signal that a duplicate transmission was received by the receiver.
//
DuplicateAck()

// Retransmission is a signal that an acknowledgement was not received from the receiver within the round-trip time
// window, and the transmitter sent another copy of the message.
//
Retransmission(int)

// ProbeRTT will return bool when the transmitter is due to probe round trip time. It will also record that true
// response and will not return true again until the algorithm wants another RTT probe.
//
ProbeRTT() bool

// UpdateRTT pushes a round-trip time probe result onto the algorithm, allowing it to adapt its RetxMs calculation
// accordingly.
//
UpdateRTT(rttMs int)

// RetxMs returns the current timeout value for retransmission events.
//
RetxMs() int

// RxPortalSize returns the currently observed size of the receiver's buffer.
//
RxPortalSize() int

// UpdateRxPortalSize updates the observed size of the receiver's buffer.
//
UpdateRxPortalSize(int)

// Profile returns the requested tunables for this algorithm.
//
Profile() *TxProfile
}

Expand Down
3 changes: 3 additions & 0 deletions westworld.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ func (self *WestworldAlgorithm) RxPortalSize() int {
return 0
}

func (self *WestworldAlgorithm) UpdateRxPortalSize(int) {
}

func (self *WestworldAlgorithm) Profile() *TxProfile {
return nil
}
Expand Down

0 comments on commit d969096

Please sign in to comment.