Actions
Feature #11500
open[RFC] rename Queue to UnboundedQueue
Status:
Open
Assignee:
-
Target version:
-
Description
Then deprecate and warn on usage of "Queue"
Or maybe even call the new one "UnsafeQueue" :)
I think the name "Queue" causes too many people to use it without
knowing the consequences of unbounded memory growth and lack of backpressure.
In all cases I can think of, SizedQueue should be used instead of
current Queue since it will not cause a process to grow out-of-memory.
On the other hand, Ruby still has too many ways for users to shoot themselves in
the foot with unbounded memory growth:
- using IO#read with no length argument
- IO#gets on unknown data
- Net::HTTP or open-uri to slurp a big file into memory
- "SELECT" from a DB library with no LIMIT
... etc.
And having one extra guideline won't help less-experienced Rubyists at all...
Updated by hsbt (Hiroshi SHIBATA) over 3 years ago
- Tracker changed from Misc to Feature
Actions
Like0
Like0