You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Java Queue interface implementation that stores directly to SqliteDb
6
+
> A Java Queue interface implementation that stores directly to SqliteDb
4
7
5
8
## How it works
6
9
@@ -19,3 +22,47 @@ A Java Queue interface implementation that stores directly to SqliteDb
19
22
for new developers would be to hold only a single instance of the `SQLitePersistentQueue` class
20
23
in your Application class, and retrieve this wherever you want. Also **DO NOT** forget to call `close()`
21
24
to close the connection to the Database once you are finished using the Queue.
25
+
26
+
## How to use
27
+
28
+
You need to implement the `QueueObjectConverter<T>` class (T is the type of the object you are storing in the Queue) **to decide how you want to serialize/deserialize objects** as objects are converted to strings before being saved in the database.
29
+
30
+
A Sample implementation of the `QueueObjectConverter` interface:
31
+
> Here I use Gson to convert objects to/from json strings
This implementation you should pass to the constructor of `SQLitePersistentQueue` class. The `SQLitePersistentQueue` uses this implementation to convert objects to/from strings before returning storing/retreiving from the SqliteDb.
0 commit comments