A potential problem arises with the current design when an outside user is responsible for generating items that go into the queue.
If the user can cause items to queue faster than they are processed, memory will eventually be exhausted, leading to unpredicatable and possible undesirable results.
For a given application, there is a likely a finite number that would be a reasonable queue size limit-- something much higher than normal use, but less than all the memory in the system.
If this limit were ever reached an exception could be thrown.
A potential problem arises with the current design when an outside user is responsible for generating items that go into the queue.
If the user can cause items to queue faster than they are processed, memory will eventually be exhausted, leading to unpredicatable and possible undesirable results.
For a given application, there is a likely a finite number that would be a reasonable queue size limit-- something much higher than normal use, but less than all the memory in the system.
If this limit were ever reached an exception could be thrown.