You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/02/23 19:30:26 UTC
[GitHub] [flink-statefun] sjwiesman commented on a change in pull request #303: [FLINK-26340][statefun-golang-sdk] Add ability in Golang SDK to create new statefun.Context from existing one, but with a new underlying context.Context
sjwiesman commented on a change in pull request #303:
URL: https://github.com/apache/flink-statefun/pull/303#discussion_r813245835
##########
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:
The statefun context very explicitly has shared state. It is effectively building the return payload from the batch of messages. Self is static for all messages in the batch. Caller is message specific, but from user code perspective both are immutable for the full invocation.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org