Open pschichtel opened 6 years ago
I switched to the ObjectQueue as the backing structure as I generally agree that it's more useful, however I'm not entirely sure what overhead this adds in case I'm really only using byte[] buffers (as I am in the project where code this originally comes from).
The current implementation is also unbounded and I don't intend to implement an upper bound because the backing queue also doesn't have an upper bound. If an upper bound is added to the QueueFile in the future it would be good to add one here as well.
I'll take a look into directly accessing QueueFile for BlockingQueue<byte[]> instance without duplicating the whole class.
@f2prateek So that's the state I would go with. In order to implement ObjectQueue<byte[]>
on QueueFile I had to break the current API a little as file():QueueFile
on ObjectQueue
conflicted with file():File
in QueueFile
, so I moved file():QueueFile
to FileObjectQueue
. This way we don't have the noop file():QueueFile
on InMemoryObjectQueue
and QueueFile
can implement ObjectQueue<byte[]>
basically as-is.
Any updates here?
@NightlyNexus I guess this won't be merged?
The resulting BlockingFileQueue is thread-safe and unbounded. Thread-safety is implemented with a single lock around all operations against the backing queue.
Closes #198