Squeak Class Documentation category index | class index  
 
SharedQueue
  category: Collections-Sequenceable
  superclass: Object
  subclasses:

I provide synchronized communication of arbitrary objects between Processes. An object is sent by sending the message nextPut: and received by sending the message next. If no object has been sent when a next message is sent, the Process requesting the object will be suspended until one is sent.

instance methods
  accessing
  flush
flushAllSuchThat:
next
nextOrNil
nextOrNilSuchThat:
nextPut:
peek
size

  private
  init:
makeRoomAtEnd

  testing
  isEmpty

class methods
  instance creation
  new
new:

instance methods
  accessing top  
 

flush

Throw out all pending contents


 

flushAllSuchThat:

Remove from the queue all objects that satisfy aBlock.


 

next

Answer the object that was sent through the receiver first and has not
yet been received by anyone. If no object has been sent, suspend the
requesting process until one is.


 

nextOrNil

Answer the object that was sent through the receiver first and has not
yet been received by anyone. If no object has been sent, answer <nil>.


 

nextOrNilSuchThat:

Answer the next object that satisfies aBlock, skipping any intermediate objects.
If no object has been sent, answer <nil> and leave me intact.
NOTA BENE: aBlock MUST NOT contain a non-local return (^).


 

nextPut:

Send value through the receiver. If a Process has been suspended
waiting to receive a value through the receiver, allow it to proceed.


 

peek

Answer the object that was sent through the receiver first and has not
yet been received by anyone but do not remove it from the receiver. If
no object has been sent, suspend the requesting process until one is.


 

size

Answer the number of objects that have been sent through the
receiver and not yet received by anyone.


  private top  
 

init:


 

makeRoomAtEnd


  testing top  
 

isEmpty

Answer whether any objects have been sent through the receiver and
not yet received by anyone.


class methods
  instance creation top  
 

new

Answer a new instance of SharedQueue that has 10 elements.


 

new:

Answer an instance of this class with the number of indexable
variables specified by the argument, sizeRequested.