Documentation
¶
Index ¶
Constants ¶
View Source
const ( REDIS_ID_PREFIX = "celery-task-meta-" REDIS_TIME_LAYOUT = "2006-01-02T15:04:05.999999" )
Variables ¶
View Source
var (
READY_STATES = mapset.NewSet("SUCCESS", "FAILURE", "REVOKED")
)
Functions ¶
This section is empty.
Types ¶
type Celery ¶
type Celery struct { Broker CeleryBroker Backend CeleryBackend }
type CeleryBackend ¶
type CeleryBackend interface {
GetCeleryResult(string) (*ResultMessage, error)
}
type CeleryBody ¶
type CeleryBody struct { Args []any `json:"args"` Kwargs map[string]any `json:"kwargs"` Data CeleryBodyData `json:"data"` }
func (CeleryBody) ArgsRepr ¶
func (cb CeleryBody) ArgsRepr() string
func (CeleryBody) Encode ¶
func (cb CeleryBody) Encode() string
type CeleryBodyData ¶
type CeleryBroker ¶
type CeleryBroker interface {
SendCeleryMessage(string, *CeleryMessage) error
}
type CeleryDeliveryInfo ¶
type CeleryHeaders ¶
type CeleryHeaders struct { Lang string `json:"lang"` Task string `json:"task"` ID string `json:"id"` Shadow *string `json:"shadow"` Eta *string `json:"eta"` Expires *string `json:"expires"` Group *int `json:"group"` GroupIndex *int `json:"group_index"` Retries int `json:"retries"` TimeLimit []*string `json:"timelimit"` RootID string `json:"root_id"` ParentID *int `json:"parent_id"` ArgsRepr string `json:"argsrepr"` KwargsRepr string `json:"kwargsrepr"` Origin string `json:"origin"` IgnoreResult bool `json:"ignore_result"` }
type CeleryMessage ¶
type CeleryMessage struct { Body string `json:"body"` ContentEncoding string `json:"content-encoding"` ContentType string `json:"content-type"` Headers CeleryHeaders `json:"headers"` Properties CeleryProperties `json:"properties"` }
func NewCeleryMessage ¶
func NewCeleryMessage(queue string, task string, args ...any) *CeleryMessage
type CeleryProperties ¶
type CeleryProperties struct { CorrelationID string `json:"correlation_id"` ReplyTo string `json:"reply_to"` DeliveryMode int `json:"delivery_mode"` DeliveryInfo CeleryDeliveryInfo `json:"delivery_info"` Priority int `json:"priority"` BodyEncoding string `json:"body_encoding"` DeliveryTag string `json:"delivery_tag"` }
type RedisBackend ¶
func NewRedisBackend ¶
func NewRedisBackend(url string) *RedisBackend
func (RedisBackend) GetCeleryResult ¶
func (r RedisBackend) GetCeleryResult(ID string) (*ResultMessage, error)
type RedisBroker ¶
func NewRedisBroker ¶
func NewRedisBroker(url string) *RedisBroker
func (RedisBroker) SendCeleryMessage ¶
func (r RedisBroker) SendCeleryMessage(queue string, cm *CeleryMessage) error
type Result ¶
type Result struct { ID string Backend CeleryBackend Result *ResultMessage }
Click to show internal directories.
Click to hide internal directories.