gorse icon indicating copy to clipboard operation
gorse copied to clipboard

implement queue in data storage

Open zhenghaoz opened this issue 3 years ago • 0 comments

Background

In Gorse v0.4.x, neighbors, and models are not updated until the next round of full dataset loading. In practice, it would be better to update neighbors or models once a new user, item, or feedback is inserted. A queue is required to achieve this goal.

Design

type Database interface {

       // Enqueue put the value to the back of a named queue.
       Enqueue(name, value string) error

       // Dequeue remove the front value of a named queue and return this value. 
       // If no value in the queue, return io.EOF.
       Dequeue(name string) (value string, err error) 
}

zhenghaoz avatar Nov 23 '22 12:11 zhenghaoz