This content originally appeared on DEV Community and was authored by Rajrishi Vishwakarma
What is BlockingQueue?
BlockingQueue is a data structure to provide Queue like capability in multithreading environment.
put()
offer() -> Exception #blocking
Element take()
poll()
poll(time, unit) -> exception
boolean remove(element)
drain(targetCollection)
drain(targetCollection, numberOfElements)
Element peek()
Element element() -> exception
int size()
int remainingCapacity()
boolean contains(Element)
This content originally appeared on DEV Community and was authored by Rajrishi Vishwakarma
Rajrishi Vishwakarma | Sciencx (2025-02-27T02:59:59+00:00) Multithreading | Java BlockingQueue. Retrieved from https://www.scien.cx/2025/02/27/multithreading-java-blockingqueue/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.
