watchtower/wtclient: generic disk overflow queue

In this commit, a new generic DiskOverflowQueue implementation is added.
This allows a user to specify a maximum number of items that the queue
can hold in-memory. Any new items will then overflow to disk. The
producer and consumer of the queue items will interact with the queue
just like a normal in-memory queue.
This commit is contained in:
Elle Mouton committed 2023-05-16 10:57:50 +02:00
1 parent 66f6bf3955
commit e91fe50878
3 files changed
+1005

No files matched your search

+4
View File
@@ -51,6 +51,10 @@ const (
// random number of blocks to delay closing a session after its last
// channel has been closed.
DefaultSessionCloseRange = 288
// DefaultMaxTasksInMemQueue is the maximum number of items to be held
// in the in-memory queue.
DefaultMaxTasksInMemQueue = 2000
)
// genSessionFilter constructs a filter that can be used to select sessions only