Skip to content

changes to be able to use streaming with seaside #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ request handling
writeResponse: response on: streamTransientStackValue
"Write response to stream and flush the stream"

response writeOn: streamTransientStackValue value.
response isStreamingResponse
ifTrue: [ self write: response duringTransactionOn: streamTransientStackValue value ]
ifFalse: [ response writeOn: streamTransientStackValue value ].
streamTransientStackValue value flush.
self logResponse: response
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"socketStreamOn:" : "dkh 01/07/2015 16:40",
"start" : "dkh 01/07/2015 17:46",
"stop:" : "dkh 01/07/2015 17:49",
"writeResponse:on:" : "dkh 01/07/2015 16:40",
"writeResponse:on:" : "PaulDeBruicker 06/28/2022 14:26",
"writeResponseBad:on:" : "dkh 01/08/2015 17:03",
"writeResponseSafely:on:" : "dkh 01/07/2015 18:29" } }

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*zinc-http
isStreamingResponse
^ false
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"class" : {
},
"instance" : {
"deprecated:on:in:" : "SvenVanCaekenberghe 07/20/2012 01:11:50" } }
"deprecated:on:in:" : "SvenVanCaekenberghe 07/20/2012 01:11:50",
"isStreamingResponse" : "PaulDeBruicker 06/24/2022 16:43" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
request handling
write: response duringTransactionOn: stream
| commitResult |
System inTransaction
ifTrue: [
"We already are in a transaction, so just write the response"
response writeOn: stream.
^ true ]
ifFalse: [
[
System beginTransaction.
response writeOn: stream ]
ensure: [
"workaround for Bug 42963: ensure: block executed twice (don't return from ensure: block)"
commitResult := System commitTransaction ] ].
^ commitResult
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
request handling
writeResponse: response on: stream
"Write response to stream and flush the stream"

response writeOn: stream.
stream flush.
self logResponse: response
"Write response to stream and flush the stream"

response isStreamingResponse
ifTrue: [ self write: response duringTransactionOn: stream ]
ifFalse: [ response writeOn: stream ].
stream flush.
self logResponse: response
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@
"stop:" : "dkh 12/06/2014 15:00",
"stopLogging" : "SvenVanCaekenberghe 10/4/2011 12:35",
"withMaximumEntitySizeDo:" : "SvenVanCaekenberghe 9/5/2012 12:49",
"writeResponse:on:" : "SvenVanCaekenberghe 12/14/2010 14:37" } }
"write:duringTransactionOn:" : "PaulDeBruicker 06/28/2022 14:25",
"writeResponse:on:" : "PaulDeBruicker 06/28/2022 14:22" } }
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ request handling
writeResponse: response on: streamTransientStackValue
"Write response to stream and flush the stream"

response writeOn: streamTransientStackValue value.
response isStreamingResponse
ifTrue: [
GRPlatform current
doTransaction: [ response writeOn: streamTransientStackValue value ] ]
ifFalse: [ response writeOn: streamTransientStackValue value ].
streamTransientStackValue value flush.
self logResponse: response
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"serverSocket" : "dkh 12/08/2014 15:51",
"socketStreamOn:" : "dkh 12/08/2014 15:21",
"stop:" : "dkh 12/08/2014 15:21",
"writeResponse:on:" : "dkh 12/08/2014 16:01",
"writeResponse:on:" : "PaulDeBruicker 06/24/2022 16:25",
"writeResponseSafely:on:" : "dkh 12/08/2014 15:58" } }
2 changes: 1 addition & 1 deletion repository/Zinc-HTTP.package/monticello.meta/version

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Metacello image
baseline: #('ZincHTTPComponents');
silently;
get.

Metacello image
baseline: #('ZincHTTPComponents');
silently;
Expand Down