task

package
v0.0.0-...-e7d9688 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(url string, pwd string, db int) *asynq.Client

func NewHandler

func NewHandler() *asynq.ServeMux

func RegisterTask

func RegisterTask(handler *asynq.ServeMux, l logger.Interface, txtGenerator webapi.IDummyTextGenerator)

Types

type IExecuteTask

type IExecuteTask[T any] interface {
	ExecuteTask(T) error
}

func GetSayHelloExecutor

func GetSayHelloExecutor(c *asynq.Client) IExecuteTask[*SayHelloPayload]

type SayHelloExecutor

type SayHelloExecutor struct {
	// contains filtered or unexported fields
}

func (*SayHelloExecutor) ExecuteTask

func (s *SayHelloExecutor) ExecuteTask(pl *SayHelloPayload) error

type SayHelloPayload

type SayHelloPayload struct {
	Message string
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(handler asynq.Handler, url string, pwd string, db int) *Server

func (*Server) Run

func (s *Server) Run() error

type TaskHandler

type TaskHandler = func(context.Context, *asynq.Task) error

Jump to

Keyboard shortcuts

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