We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4248ce3 commit 9c738d5Copy full SHA for 9c738d5
jsonrpc2.go
@@ -141,6 +141,8 @@ var defaultHandler = func(ctx context.Context, req *Request) {
141
}
142
143
144
+const defaultCapacity = 20
145
+
146
var defaultCanceler = func(context.Context, *Conn, ID) {}
147
148
var defaultLogger = zap.NewNop()
@@ -163,6 +165,10 @@ func NewConn(s Stream, options ...Options) *Conn {
163
165
if conn.Handler == nil {
164
166
conn.Handler = defaultHandler
167
168
+ // the default capacity is 20
169
+ if conn.Capacity == 0 {
170
+ conn.Capacity = defaultCapacity
171
+ }
172
// the default canceller does nothing
173
if conn.Canceler == nil {
174
conn.Canceler = defaultCanceler
0 commit comments