You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Galen Warren (Jira)" <ji...@apache.org> on 2022/02/23 16:09:00 UTC
[jira] [Created] (FLINK-26340) Add ability in Golang SDK to create new statefun.Context from existing one, but with a new underlying context.Context
Galen Warren created FLINK-26340:
------------------------------------
Summary: Add ability in Golang SDK to create new statefun.Context from existing one, but with a new underlying context.Context
Key: FLINK-26340
URL: https://issues.apache.org/jira/browse/FLINK-26340
Project: Flink
Issue Type: Improvement
Components: Stateful Functions
Affects Versions: statefun-3.3.0
Reporter: Galen Warren
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.
The proposal is to add a:
WithContext(ctx context.Context) statefun.Context
... method to the statefun.Context interface and implement it on statefunContext. This method would return the derived statefun context.
This is a breaking change to statefun.Context, but, given its purpose, we do not expect there to be implementations of this interface outside the Golang SDK.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)