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
Currently, AsyncQueue is unbounded, which can cause the queue to grow indefinitely.
Proposed Solution
One solution would be to use the ArrayDeque of crate::arraydeque and restrict the queue to a fixed value (e.g., 1024). This change maintains the insertion and removal operations that are already in the AsyncQueue, such as push_back, push_front, and pop_front, in addition to basic operations such as len, is_empty, iter, and iter_mut.
Another enhancement involves the use of the Saturating parameter. This feature ensures that when the queue reaches its maximum capacity, any new elements will be automatically discarded, preventing the queue from growing beyond its set limit.
The text was updated successfully, but these errors were encountered:
Context
Currently, AsyncQueue is unbounded, which can cause the queue to grow indefinitely.
Proposed Solution
One solution would be to use the
ArrayDeque
ofcrate::arraydeque
and restrict the queue to a fixed value (e.g., 1024). This change maintains the insertion and removal operations that are already in the AsyncQueue, such aspush_back
,push_front
, andpop_front
, in addition to basic operations such aslen
,is_empty
,iter
, anditer_mut
.Another enhancement involves the use of the
Saturating
parameter. This feature ensures that when the queue reaches its maximum capacity, any new elements will be automatically discarded, preventing the queue from growing beyond its set limit.The text was updated successfully, but these errors were encountered: