Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubtt in priority queue

 
rajeev jayappa
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the difference between poll and peek method
i read the api but could not get the concept
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They both returns the head of the queue, but poll() also removes the retrieved element.

Queue : 1,2,3,4
peek : 1 (queue:1,2,3,4)
peek : 1 (queue:1,2,3,4)
poll : 1 (queue:2,3,4)
peek : 2 (queue:2,3,4)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic