mirror of
https://github.com/oarkflow/mq.git
synced 2025-10-15 16:00:38 +08:00
feat: [wip] - implement storage
This commit is contained in:
13
ctx.go
13
ctx.go
@@ -4,11 +4,9 @@ import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/oarkflow/xid"
|
||||
|
||||
@@ -17,17 +15,6 @@ import (
|
||||
"github.com/oarkflow/mq/storage/memory"
|
||||
)
|
||||
|
||||
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"`
|
||||
}
|
||||
|
||||
type Handler func(context.Context, *Task) Result
|
||||
|
||||
func IsClosed(conn net.Conn) bool {
|
||||
|
Reference in New Issue
Block a user