galenwarren opened a new pull request #303: URL: https://github.com/apache/flink-statefun/pull/303
In the Golang SDK, `statefun.Context` embeds the `context.Context` interface and is implemented by the `statefunContext` struct, which embeds a `context.Context`. To support common patterns in Golang related to adding values to context, it would be useful to be able to create a derived `statefun.Context` that is equivalent to the original in terms of statefun functionality but which wraps a different `context.Context`. This PR adds: ``` WithContext(ctx context.Context) statefun.Context ``` ... to the `statefun.Context` interface and implements it on `statefunContext`. This method returns the derived statefun context. This is technically a breaking change to `statefun.Context` (i.e. addition of new method), but, given its purpose, we do not expect there to be implementations of this interface outside the Golang SDK. The changes here include: * Change `sync.Mutex` in `statefunContext` to be `*sync.Mutex` and update construction of statefunContext accordingly * Add `WithContext` to `statefun.Context` interface and implement on `statefunContext` * Add unit test -- 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]
