mirror of
https://github.com/oarkflow/mq.git
synced 2025-10-06 00:16:49 +08:00
feat: use "GetTags" and "SetTags"
This commit is contained in:
9
task.go
9
task.go
@@ -68,6 +68,8 @@ type Task struct {
|
||||
Status string `json:"status"`
|
||||
Payload json.RawMessage `json:"payload"`
|
||||
dag any
|
||||
// new deduplication field
|
||||
DedupKey string `json:"dedup_key,omitempty"`
|
||||
}
|
||||
|
||||
func (t *Task) GetFlow() any {
|
||||
@@ -84,3 +86,10 @@ func NewTask(id string, payload json.RawMessage, nodeKey string, opts ...TaskOpt
|
||||
}
|
||||
return task
|
||||
}
|
||||
|
||||
// new TaskOption for deduplication:
|
||||
func WithDedupKey(key string) TaskOption {
|
||||
return func(t *Task) {
|
||||
t.DedupKey = key
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user