Skip to content

Commit

Permalink
feat(lrdd): Delete a lrdd.Row's pool
Browse files Browse the repository at this point in the history
- This was too difficult to use and could not be applied to a real product.
  • Loading branch information
hueypark committed May 17, 2023
1 parent bbb7f20 commit e109cc8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 37 deletions.
9 changes: 4 additions & 5 deletions input/push_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,19 @@ func (p *PushStream) Dispatch() error {
return errors.Wrap(err, "stream dispatch")
}

// The user should manually return the []lrdd.Row to the pool.
rows := lrdd.GetRows(len(p.reqCache.Data))
rows := make([]lrdd.Row, len(p.reqCache.Data))
for i, row := range p.reqCache.Data {
value := lrdd.GetValue(p.reader.RowType())
_, err := value.UnmarshalMsg(row.Value)
if err != nil {
return err
}

(*rows)[i].Key = row.Key
(*rows)[i].Value = value
rows[i].Key = row.Key
rows[i].Value = value
}

p.reader.Write(*rows)
p.reader.Write(rows)

p.reqCache.RemainCapicityReset()
}
Expand Down
32 changes: 0 additions & 32 deletions lrdd/pool.go

This file was deleted.

0 comments on commit e109cc8

Please sign in to comment.