celery

package module
v0.0.0-...-6c0ce0a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2022 License: Apache-2.0 Imports: 6 Imported by: 5

README

dupman/celery

GitHub go.mod Go version of a Go module Lint and Test FOSSA Status Quality Gate Status Maintainability Rating Reliability Rating Security Rating codecov Go Report Card

Requirements

  • Go (>=1.17)

Installation

Usage

Changelog

Please see CHANGELOG for details.

Authors

License

Copyright (c) 2022 dupman.
Released under the Apache-2.0 license.

FOSSA Status

Documentation

Index

Constants

View Source
const (
	MaxIdle     = 3
	MaxActive   = 3
	IdleTimeout = 240 * time.Second
)

Variables

This section is empty.

Functions

func NewClient

func NewClient(conf *Config) (*gocelery.CeleryClient, error)

func RegisterTasks

func RegisterTasks(celery *gocelery.CeleryClient, constructors ...func(celery *gocelery.CeleryClient) TaskInterface)

Types

type Config

type Config struct {
	RedisURL string `mapstructure:"CELERY_REDIS_URL" default:"redis://"`
	Workers  int    `mapstructure:"CELERY_WORKERS" default:"5"`
}

type Task

type Task struct {
	Client    *gocelery.CeleryClient
	Namespace string
	Functions map[string]interface{}
}

func (*Task) GetNamespace

func (t *Task) GetNamespace() string

func (*Task) Register

func (t *Task) Register()

type TaskInterface

type TaskInterface interface {
	GetNamespace() string
	Register()
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL