Add Set and UniqueQueue implementations #1
Loading…
Reference in New Issue
No description provided.
Delete Branch "zeripath/levelqueue:add-set-commands"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Whilst looking at replacing the
code.gitea.io/gitea/modules/sync.UniqueQueue
andcode.gitea.io/gitea/modules/sync.Table
in Gitea with the newcode.gitea.io/gitea/modules/queue.Queue
. I realized it would nice to use the leveldb as a set holder.So how do you want to use
levelqueue
likeUniqueQueue
once the PR merged?And I think the PR needs some tests.
It'd allow me to add UniqueQueue features on top of this - although if you'd prefer I could actually make an unique queue from within this package?Another option would be to create afunc From(db leveldb.DB)
then we can create a levelqueue from a given levelDB. (Perhaps even be able to stick a prefix on the keys - so you can have more than one queue from a db?)I've just pushed an alternative up, with a new Set and UniqueQueue implementations.
Add set commandsto Add Set and UniqueQueue implementations@ -0,0 +1,184 @@
// Copyright 2020 Andrew Thornton. All rights reserved.
How about rename it to
unique_queue.go
?Great! Thanks!