[GH-ISSUE #497] [FEATURE REQUEST] Task header ability #1241

Closed
opened 2026-03-07 22:07:55 +03:00 by kerem · 1 comment
Owner

Originally created by @goxiaoy on GitHub (Jun 21, 2022).
Original GitHub issue: https://github.com/hibiken/asynq/issues/497

Originally assigned to: @hibiken on GitHub.

Is your feature request related to a problem? Please describe.
https://github.com/hibiken/asynq/issues/321
Describe the solution you'd like

Provider new asynq.Option to set custom header like http.header or map[string]string
Or like

type RecordHeader struct {
	Key   []byte
	Value []byte
}

This is helpful for tracing

func SetTracingOption(ctx context.Context) asynq.Option {
	//recover header
	var header transport.Header = propagation.HeaderCarrier(http.Header{})
	ctx = propagator.Extract(ctx, header)
	//TODO ability to set header
	panic("unimplemented")
}

Additional context
See
github.com/Shopify/sarama@7a92423e79/record.go (L15-L18)

Originally created by @goxiaoy on GitHub (Jun 21, 2022). Original GitHub issue: https://github.com/hibiken/asynq/issues/497 Originally assigned to: @hibiken on GitHub. **Is your feature request related to a problem? Please describe.** https://github.com/hibiken/asynq/issues/321 **Describe the solution you'd like** Provider new asynq.Option to set custom header like `http.header` or `map[string]string` Or like ``` type RecordHeader struct { Key []byte Value []byte } ``` This is helpful for tracing ``` func SetTracingOption(ctx context.Context) asynq.Option { //recover header var header transport.Header = propagation.HeaderCarrier(http.Header{}) ctx = propagator.Extract(ctx, header) //TODO ability to set header panic("unimplemented") } ``` **Additional context** See https://github.com/Shopify/sarama/blob/7a92423e79f75314489f9694be4013aaf5fd3593/record.go#L15-L18
kerem 2026-03-07 22:07:55 +03:00
Author
Owner

@hibiken commented on GitHub (Jun 26, 2022):

Duplicate of #393

<!-- gh-comment-id:1166627776 --> @hibiken commented on GitHub (Jun 26, 2022): Duplicate of #393
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asynq#1241
No description provided.