#DOCUMENTATION by cg
class: CollectingSharedQueueStream
category of:
#next
#nextPut:
--- a/CollectingSharedQueueStream.st Mon Nov 18 16:12:33 2019 +0100
+++ b/CollectingSharedQueueStream.st Mon Nov 18 16:14:42 2019 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"
COPYRIGHT (c) 1997 by Claus Gittinger
All Rights Reserved
@@ -165,46 +163,6 @@
^ contents at:index
"Created: 5.3.1997 / 14:44:41 / cg"
-!
-
-next
- "return the next value in the queue; if there is none,
- wait 'til something is put into the receiver."
-
- |value|
-
- [readPosition >= writePosition] whileTrue:[
- closed ifTrue:[
- ^ nil
- ].
- dataAvailable wait
- ].
-
- value := contents at:readPosition.
- readPosition := readPosition + 1.
- ^ value
-
- "Created: 5.3.1997 / 14:28:57 / cg"
- "Modified: 5.3.1997 / 14:45:54 / cg"
-!
-
-nextPut:anObject
- "append anObject to the queue; if anyone is waiting, tell him.
- Answer anObject"
-
- contents add:anObject.
- writePosition := writePosition + 1.
-
- finalSizeIfKnown isNil ifTrue:[
- signalChanges ifTrue:[
- self changed:#size with:nil
- ]
- ].
- dataAvailable signal.
- ^ anObject
-
- "Created: 5.3.1997 / 14:33:44 / cg"
- "Modified: 5.3.1997 / 15:42:33 / cg"
! !
!CollectingSharedQueueStream methodsFor:'accessing-special'!
@@ -287,6 +245,50 @@
"Modified: 5.3.1997 / 15:57:08 / cg"
! !
+!CollectingSharedQueueStream methodsFor:'reading'!
+
+next
+ "return the next value in the queue; if there is none,
+ wait 'til something is put into the receiver."
+
+ |value|
+
+ [readPosition >= writePosition] whileTrue:[
+ closed ifTrue:[
+ ^ nil
+ ].
+ dataAvailable wait
+ ].
+
+ value := contents at:readPosition.
+ readPosition := readPosition + 1.
+ ^ value
+
+ "Created: 5.3.1997 / 14:28:57 / cg"
+ "Modified: 5.3.1997 / 14:45:54 / cg"
+! !
+
+!CollectingSharedQueueStream methodsFor:'writing'!
+
+nextPut:anObject
+ "append anObject to the queue; if anyone is waiting, tell him.
+ Answer anObject"
+
+ contents add:anObject.
+ writePosition := writePosition + 1.
+
+ finalSizeIfKnown isNil ifTrue:[
+ signalChanges ifTrue:[
+ self changed:#size with:nil
+ ]
+ ].
+ dataAvailable signal.
+ ^ anObject
+
+ "Created: 5.3.1997 / 14:33:44 / cg"
+ "Modified: 5.3.1997 / 15:42:33 / cg"
+! !
+
!CollectingSharedQueueStream class methodsFor:'documentation'!
version