Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add high-priority stream flag using SetWriteDeadline magic value #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cce
Copy link
Collaborator

@cce cce commented Oct 20, 2023

This was a draft I had sitting around to provide high-priority send channel support similar to how we do sendBuffer prioritization in wsPeer.writeLoop https://github.com/algorand/go-algorand/blob/master/network/wsPeer.go#L814-L847

@@ -490,7 +498,10 @@ func (s *Stream) SetReadDeadline(t time.Time) error {
func (s *Stream) SetWriteDeadline(t time.Time) error {
s.stateLock.Lock()
defer s.stateLock.Unlock()
if s.writeState == halfOpen {
// handle magic time.Time value to signal this is a high-priority stream.
if t.Equal(HighPriorityWriteDeadlineMagicValue) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why introduce this mechanism instead of addding an additional function to enable high priority?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants