Skip to content

QUESTION: Is there a tailing iterator? #1404

@gowthamgutha

Description

@gowthamgutha

What version of Go are you using (go version)?

$ go version
go version go1.14.4 windows/amd64

What operating system are you using?

Windows (but GOOS=linux)

What version of Badger are you using?

github.com/dgraph-io/badger/v2

We have a requirement where we only write the keys (key=time_in_millis + counter) and remove them (no updates).
We would like to have 2 go routines, one that puts into the db and the other that iterates in insertion order and removes entry from the map when a certain condition is met.

We would like to have a tailing iterator that iterates over the values as they are put into the map (i.e. the iterator should not create a snapshot and that I should be getting all the new entries as they are added to the map in the insertion order by another go routine). If there are no entries in the map, then it should block.

Is this possible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/questionSomething requiring a response

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions