-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
POC implementation of WAComboResponse acting directly on a socket stream
- Loading branch information
Showing
12 changed files
with
65 additions
and
35 deletions.
There are no files selected for viewing
5 changes: 3 additions & 2 deletions
5
repository/Seaside-Core.package/WAComboResponse.class/class/external..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
instance creation | ||
external: anExternalStream | ||
^ self | ||
onBuffered: (GRPlatform current writeCharacterStreamOn: (String new: 4096)) | ||
external: anExternalStream | ||
onStream: anExternalStream | ||
bufferSize: 4096 | ||
codec: GRNullCodec new |
3 changes: 0 additions & 3 deletions
3
repository/Seaside-Core.package/WAComboResponse.class/class/onBuffered.external..st
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
repository/Seaside-Core.package/WAComboResponse.class/class/onStream.bufferSize.codec..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
instance creation | ||
onStream: aStream bufferSize: anInteger codec: aGRCodec | ||
^ self basicNew | ||
initializeOnStream: aStream bufferSize: anInteger codec: aGRCodec; | ||
yourself |
3 changes: 3 additions & 0 deletions
3
repository/Seaside-Core.package/WAComboResponse.class/instance/codec..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
codec: aCodec | ||
^ codec |
3 changes: 3 additions & 0 deletions
3
repository/Seaside-Core.package/WAComboResponse.class/instance/codec.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
codec | ||
^ codec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ destroy | |
|
||
super destroy. | ||
bufferedStream := nil. | ||
externalStream := nil | ||
externalStream := nil. | ||
codec := nil |
9 changes: 0 additions & 9 deletions
9
...ory/Seaside-Core.package/WAComboResponse.class/instance/initializeOnBuffered.external..st
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
...aside-Core.package/WAComboResponse.class/instance/initializeOnStream.bufferSize.codec..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
initialization | ||
initializeOnStream: aStream bufferSize: anInteger codec: aGRCodec | ||
"Initialize the receiver" | ||
|
||
| rawBufferedStream | | ||
self initialize. | ||
codec := aGRCodec. | ||
rawBufferedStream := GRPlatform current writeCharacterStreamOn: (String new: anInteger). | ||
bufferedStream := GRCountingStream on: (aGRCodec encoderFor: rawBufferedStream). | ||
externalStream := GRBinaryConvertingStream on: aStream. | ||
committed := false. | ||
closed := false |
24 changes: 13 additions & 11 deletions
24
repository/Seaside-Core.package/WAComboResponse.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
{ | ||
"commentStamp" : "pmm 8/25/2019 11:14", | ||
"super" : "WAResponse", | ||
"category" : "Seaside-Core-HTTP", | ||
"classinstvars" : [ ], | ||
"pools" : [ ], | ||
"classvars" : [ ], | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "ar 8/4/2010 20:31", | ||
"instvars" : [ | ||
"bufferedStream", | ||
"externalStream", | ||
"codec", | ||
"committed", | ||
"closed" | ||
], | ||
"externalStream", | ||
"closed", | ||
"bufferedStream" ], | ||
"name" : "WAComboResponse", | ||
"type" : "normal" | ||
} | ||
"pools" : [ | ||
], | ||
"super" : "WAResponse", | ||
"type" : "normal" } |
14 changes: 14 additions & 0 deletions
14
...ory/Seaside-Tests-Core.package/WAComboResponseTest.class/instance/testWithBinaryStream.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
tests | ||
testWithBinaryStream | ||
(FileSystem memory / 'socket') binaryWriteStreamDo: [ :binaryStream | | ||
response := WAComboResponse | ||
onStream: binaryStream | ||
bufferSize: 4096 | ||
codec: GRPharoUtf8Codec new. | ||
|
||
response | ||
nextPut: Character space; | ||
flush; | ||
close ] | ||
|
||
|
8 changes: 3 additions & 5 deletions
8
repository/Zinc-Seaside.package/ZnZincStreamingServerAdaptor.class/instance/responseFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
converting | ||
responseFor: aZnRequest | ||
| bufferedStream codecStream | | ||
bufferedStream := GRPlatform current writeCharacterStreamOn: (String new: 4096). | ||
codecStream := self codec encoderFor: bufferedStream. | ||
^ WAComboResponse | ||
onBuffered: (GRCountingStream on: codecStream) | ||
external: aZnRequest stream | ||
onStream: aZnRequest stream | ||
bufferSize: 4096 | ||
codec: self codec |