File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 1- # sqlite-persistent-queue
1+ # SQLite based Persistent Queue.
2+
23A Java Queue interface implementation that stores directly to SqliteDb
4+
5+ ## How it works
6+
7+ * Implement the ` QueueObjectConverter<T> ` interface do decide how you want to serialize and
8+ deserialize the objects that you want to push to the Queue.
9+
10+ * The ` SQLitePersistentQueue ` class uses the above implementation to serialize objects before storing
11+ it the Database.
12+
13+ * Upon calling ` poll() ` or ` remove() ` on the ` SQLitePersistentQueue ` the item with the lowest primary
14+ key value (since the primary key is auto-incrementing) is removed from the Queue and returned. This
15+ co-incidentally is the HEAD of the queue (as queue is FIFO based).
16+
17+ * Please remember each instance of SQLitePersistentQueue creates a new connection to the Database.
18+ I have kept the freedom of how many connections to be made to DB to the developer. The ideal usage
19+ for new developers would be to hold only a single instance of the ` SQLitePersistentQueue ` class
20+ in your Application class, and retrieve this wherever you want. Also ** DO NOT** forget to call ` close() `
21+ to close the connection to the Database once you are finished using the Queue.
You can’t perform that action at this time.
0 commit comments