Skip to content

Commit

Permalink
Make ZnDefaultServerDelegate aware of the server it is embedded in (n…
Browse files Browse the repository at this point in the history
…ot just through ZnCurrentServer during a request/response cylce, but also statically)
  • Loading branch information
svenvc committed Dec 2, 2023
1 parent 2422eca commit aeacce3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
server: znServer
"Set my server to snServer, the one I am the delegate for"

server := znServer
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
server
"Return the ZnServer I was configured with, the one I am the delegate for"

^ server
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"classvars" : [ ],
"instvars" : [
"prefixMap",
"byteArray"
"byteArray",
"server"
],
"name" : "ZnDefaultServerDelegate",
"type" : "normal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ delegate
the object that will be sent #handleRequest: to handle a request and produce a response.
The default delegate is ZnDefaultServerDelegate"

^ self optionAt: #delegate ifAbsentPut: [ ZnDefaultServerDelegate new ]
^ self
optionAt: #delegate
ifAbsentPut: [ ZnDefaultServerDelegate new server: self; yourself ]

0 comments on commit aeacce3

Please sign in to comment.