Skip to content

How to pass context creating function #338

Open
@oantoshchenko-skillz

Description

@oantoshchenko-skillz

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?

Metadata

Metadata

Assignees

Labels

questionQuestion regarding how RxGo is working etc.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions