Documentation ¶
Index ¶
- type Collector
- type Request
- func (req *Request) Cancel()
- func (req *Request) Done() <-chan struct{}
- func (req *Request) Error(err error)
- func (req *Request) Fill(bs []blocks.Block) bool
- func (req *Request) Fulfilled() bool
- func (req *Request) Id() uint32
- func (req *Request) Next() ([]blocks.Block, error)
- func (req *Request) Remains() []cid.Cid
- type RequestQueue
- type Result
- type Stream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector aggregates batches of blocks limited to some max size and fills requests with them.
func NewCollector ¶
func NewCollector(ctx context.Context, reqs <-chan *Request, blocks blockstore.Blockstore, max int) *Collector
NewCollector creates new Collector
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request is a tuple of Request Request params.
func NewRequest ¶
NewRequest creates new Request.
func (*Request) Done ¶
func (req *Request) Done() <-chan struct{}
Done returns done channel of underlying context.
type RequestQueue ¶
type RequestQueue struct {
// contains filtered or unexported fields
}
func NewRequestQueue ¶
func NewRequestQueue(done <-chan struct{}) *RequestQueue
func (*RequestQueue) Back ¶
func (rq *RequestQueue) Back() *Request
func (*RequestQueue) BackPopDone ¶
func (rq *RequestQueue) BackPopDone() *Request
func (*RequestQueue) Cancel ¶
func (rq *RequestQueue) Cancel(id uint32)
func (*RequestQueue) Enqueue ¶
func (rq *RequestQueue) Enqueue(reqs ...*Request)
func (*RequestQueue) Len ¶
func (rq *RequestQueue) Len() int
func (*RequestQueue) PopBack ¶
func (rq *RequestQueue) PopBack()
Click to show internal directories.
Click to hide internal directories.