Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass context creating function #338

Open
oantoshchenko-skillz opened this issue Dec 13, 2021 · 0 comments
Open

How to pass context creating function #338

oantoshchenko-skillz opened this issue Dec 13, 2021 · 0 comments
Assignees
Labels
question Question regarding how RxGo is working etc.

Comments

@oantoshchenko-skillz
Copy link

I am using rxgo to create long pullers (SQS), and I want to add information to (control creation of) the context.Context value, to go through the pipeline. I have a control over creation of observable and ideally I would use something like:

	pullingObservable := rxgo.FromChannel(messageChannel, rxgo.CreateContextOption(func() context.Context{
		return context.WithValue(context.Background(), someKey, someValue)
	}))

The context has to be unique per message as I want to assign a receipt handle to the context and bind it to my context-based logging system, so I can't use rxgo.WithContext.

Is there a way to do that, or do I have to add context explicitly to the Item and drug it all the way explicitly?

@oantoshchenko-skillz oantoshchenko-skillz added the question Question regarding how RxGo is working etc. label Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question regarding how RxGo is working etc.
Projects
None yet
Development

No branches or pull requests

2 participants