I have a thread that basically contains
while(true) {
current = BlockingQueue.take();
results = queryDatabaseWith(current);
AtomicReference.set( results );
}
Realistically the queue is only ever going to have a few things put on it, but it's important that when things are, the DB queries happen in the correct order. The atomic ref is fine as I only care about the results from the last DB query.
Is it bad practice to have this on a thread, basically waiting all day?