File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -164,6 +164,8 @@ type Server struct {
164164
165165 // NewWriteScheduler constructs a write scheduler for a connection.
166166 // If nil, a default scheduler is chosen.
167+ //
168+ // Deprecated: User-provided write schedulers are deprecated.
167169 NewWriteScheduler func () WriteScheduler
168170
169171 // CountError, if non-nil, is called on HTTP/2 server errors.
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ import "fmt"
88
99// WriteScheduler is the interface implemented by HTTP/2 write schedulers.
1010// Methods are never called concurrently.
11+ //
12+ // Deprecated: User-provided write schedulers are deprecated.
1113type WriteScheduler interface {
1214 // OpenStream opens a new stream in the write scheduler.
1315 // It is illegal to call this with streamID=0 or with a streamID that is
@@ -38,6 +40,8 @@ type WriteScheduler interface {
3840}
3941
4042// OpenStreamOptions specifies extra options for WriteScheduler.OpenStream.
43+ //
44+ // Deprecated: User-provided write schedulers are deprecated.
4145type OpenStreamOptions struct {
4246 // PusherID is zero if the stream was initiated by the client. Otherwise,
4347 // PusherID names the stream that pushed the newly opened stream.
@@ -47,6 +51,8 @@ type OpenStreamOptions struct {
4751}
4852
4953// FrameWriteRequest is a request to write a frame.
54+ //
55+ // Deprecated: User-provided write schedulers are deprecated.
5056type FrameWriteRequest struct {
5157 // write is the interface value that does the writing, once the
5258 // WriteScheduler has selected this frame to write. The write
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ import (
1414const priorityDefaultWeightRFC7540 = 15 // 16 = 15 + 1
1515
1616// PriorityWriteSchedulerConfig configures a priorityWriteScheduler.
17+ //
18+ // Deprecated: User-provided write schedulers are deprecated.
1719type PriorityWriteSchedulerConfig struct {
1820 // MaxClosedNodesInTree controls the maximum number of closed streams to
1921 // retain in the priority tree. Setting this to zero saves a small amount
@@ -55,6 +57,9 @@ type PriorityWriteSchedulerConfig struct {
5557// NewPriorityWriteScheduler constructs a WriteScheduler that schedules
5658// frames by following HTTP/2 priorities as described in RFC 7540 Section 5.3.
5759// If cfg is nil, default options are used.
60+ //
61+ // Deprecated: The RFC 7540 write scheduler has known bugs and performance issues,
62+ // and RFC 7540 prioritization was deprecated in RFC 9113.
5863func NewPriorityWriteScheduler (cfg * PriorityWriteSchedulerConfig ) WriteScheduler {
5964 return newPriorityWriteSchedulerRFC7540 (cfg )
6065}
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ import "math"
1010// priorities. Control frames like SETTINGS and PING are written before DATA
1111// frames, but if no control frames are queued and multiple streams have queued
1212// HEADERS or DATA frames, Pop selects a ready stream arbitrarily.
13+ //
14+ // Deprecated: User-provided write schedulers are deprecated.
1315func NewRandomWriteScheduler () WriteScheduler {
1416 return & randomWriteScheduler {sq : make (map [uint32 ]* writeQueue )}
1517}
You can’t perform that action at this time.
0 commit comments