Skip to content

Commit

Permalink
[feenkcom/gtoolkit#4347] GtRsrVersionedEvaluator>>startEvaluateAsyncS…
Browse files Browse the repository at this point in the history
…cript: set the current GS session for the wire encoder
  • Loading branch information
akgrant43 committed Mar 10, 2025
1 parent 7f9ad99 commit 3eafc48
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/GToolkit-GemStone-Pharo/GtRsrVersionedEvaluator.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ GtRsrVersionedEvaluator >> startEvaluateAsyncScript: aGtRsrScriptEvaluation [
aGtRsrScriptEvaluation serialisationStrategy
ifNil: [ self error: 'Serialization strategy not yet set' ].

resolvedBindings := self bindingsFrom: aGtRsrScriptEvaluation bindings.
GtGemStoneCurrentSession value: self gtSession during:
[ resolvedBindings := self bindingsFrom: aGtRsrScriptEvaluation bindings ].

^ aGtRsrScriptEvaluation executeBlockWithDeliveryLogging: [
rsrPromise := self remoteSelf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,40 @@ GtRemoteGemStoneWireEncodingExamples >> passAndRetrieveGeneralObject [
self assert: result last items first equals: anObject last items first.
]

{ #category : #examples }
GtRemoteGemStoneWireEncodingExamples >> passProxyAsync [
"Check sending a proxy object to GemStone using wire encoding"
<gtExample>
| session serialisationStrategy result receiver remoteBindings remoteScript autoCommit object promise |

session := self runningServer.
(self canTestInSession: session) ifFalse: [ ^ 'unsupported feature' ].
receiver := nil.
remoteBindings := Dictionary new
at: #clientVar put: (GtRsrTestServiceClient new object: (Dictionary new at: #a put: 'client'; yourself));
yourself.
remoteScript := 'GtRsrTestServiceServer new object: (Dictionary new
at: #a put: ''done'';
at: #cv put: clientVar;
yourself)'.
serialisationStrategy := #GtRsrLegacySerializationStrategy.
autoCommit := false.
promise := (session
createScriptEvaluationFor: remoteScript
receiver: receiver
bindings: remoteBindings
serializationStrategy: serialisationStrategy
autoCommit: autoCommit)
beAsyncExecution;
evaluate.
result := promise value.
self assert: result class equals: GtRsrTestServiceClient.
object := result object.
self assert: object class equals: Dictionary.
self assert: object size equals: 2.
self assert: ((object at: #cv) object at: #a) equals: ((remoteBindings at: #clientVar) object at: #a).
]

{ #category : #examples }
GtRemoteGemStoneWireEncodingExamples >> performWithAssociation [
<gtExample>
Expand Down

0 comments on commit 3eafc48

Please sign in to comment.