austince commented on a change in pull request #303:
URL: https://github.com/apache/flink-statefun/pull/303#discussion_r813117321



##########
File path: statefun-sdk-go/v3/pkg/statefun/context.go
##########
@@ -76,6 +81,12 @@ func (s *statefunContext) Storage() AddressScopedStorage {
        return s.storage
 }
 
+func (s *statefunContext) WithContext(ctx context.Context) Context {
+       newContext := *s
+       newContext.Context = ctx
+       return &newContext

Review comment:
       Will this then share the mutex across both contexts? Reading [this 
thread](https://groups.google.com/g/golang-nuts/c/imxjBLNJ9OY), it seems like 
another approach would be to lock the mutex, copy the protected fields into a 
new object (which holds a new mutex), then unlock. We may also want to copy the 
other pointer fields like caller, storage, address. wdyt? 
   
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to