mirror of
https://github.com/oarkflow/mq.git
synced 2025-10-04 23:52:48 +08:00
feat: [wip] - implement storage
This commit is contained in:
11
task.go
11
task.go
@@ -5,6 +5,17 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Task struct {
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
ProcessedAt time.Time `json:"processed_at"`
|
||||
Expiry time.Time `json:"expiry"`
|
||||
Error error `json:"error"`
|
||||
ID string `json:"id"`
|
||||
Topic string `json:"topic"`
|
||||
Status string `json:"status"`
|
||||
Payload json.RawMessage `json:"payload"`
|
||||
}
|
||||
|
||||
func NewTask(id string, payload json.RawMessage, nodeKey string) *Task {
|
||||
if id == "" {
|
||||
id = NewID()
|
||||
|
Reference in New Issue
Block a user