blob: 2e7693aa2804efd010bd8fbf4cfbaea0d0c96f0f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
/*
Since Bilibili only uses WebSocket binary message,
the transportation is effectively a datagram channel.
So we use a consumer-supplier abstraction to decouple
the real protocol with WebSocket stuff.
*/
package dmpkg
type Consumer[T any] interface {
Consume(value T) error
}
type Supplier[T any] interface {
Get() (T, error)
}
|