Skip to content
This repository has been archived by the owner on Mar 11, 2022. It is now read-only.

(crdt|eventsourced).Context vs. context.Context #22

Closed
marcellanz opened this issue Apr 21, 2020 · 1 comment
Closed

(crdt|eventsourced).Context vs. context.Context #22

marcellanz opened this issue Apr 21, 2020 · 1 comment
Assignees
Labels

Comments

@marcellanz
Copy link
Contributor

We should have a story to enable user functions to get the context.Context from the gRPC server handler function in a clean way. context.Context shall be propagated (and not stored in struct types) by chained func calls, but having functions like

func handleCommand(c context.Context, ctx crdt.Context, ....)

is one context too much to bear for an API.

@marcellanz marcellanz added the enhancement New feature or request label Apr 21, 2020
@marcellanz marcellanz changed the title (crdt.Context|eventsourced).Context vs. context.Context (crdt|eventsourced).Context vs. context.Context Apr 21, 2020
@marcellanz marcellanz added this to the Go Support v0.2.0 milestone Jun 16, 2020
@marcellanz
Copy link
Contributor Author

marcellanz commented Jul 5, 2020

(crdt|eventsourced).Context will get the stream context embedded. Contrary to some wisdom in the packages documentation https://golang.org/pkg/context/
We do not embedd the context for other purposes than having it on the call stack and with limited lifespan of an entity running. There is a certain consent, that the recommendation by the context package should be relaxed golang/go#22602.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant