asynq

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CronSpec_User_UpdateUser = "@every 120s"
View Source
const Pattern_User_CreateUser = "user:create"
View Source
const Pattern_User_UpdateUser = "user:update"

Variables

View Source
var File_asynq_proto protoreflect.FileDescriptor

Functions

func RegisterScheduler_User_UpdateUser added in v0.7.0

func RegisterScheduler_User_UpdateUser(scheduler *asynq.Scheduler, settings *asynq_auxiliary.ClientSettings, in *UpdateUserPayload, opts ...asynq.Option) (entryId string, err error)

func RegisterUserTaskHandler

func RegisterUserTaskHandler(mux *asynq.ServeMux, srv UserTaskHandler, opts ...asynq_auxiliary.HandlerOption)

Types

type CreateUserPayload

type CreateUserPayload struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateUserPayload) Descriptor deprecated

func (*CreateUserPayload) Descriptor() ([]byte, []int)

Deprecated: Use CreateUserPayload.ProtoReflect.Descriptor instead.

func (*CreateUserPayload) GetName

func (x *CreateUserPayload) GetName() string

func (*CreateUserPayload) ProtoMessage

func (*CreateUserPayload) ProtoMessage()

func (*CreateUserPayload) ProtoReflect

func (x *CreateUserPayload) ProtoReflect() protoreflect.Message

func (*CreateUserPayload) Reset

func (x *CreateUserPayload) Reset()

func (*CreateUserPayload) String

func (x *CreateUserPayload) String() string

type UpdateUserPayload

type UpdateUserPayload struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateUserPayload) Descriptor deprecated

func (*UpdateUserPayload) Descriptor() ([]byte, []int)

Deprecated: Use UpdateUserPayload.ProtoReflect.Descriptor instead.

func (*UpdateUserPayload) GetName

func (x *UpdateUserPayload) GetName() string

func (*UpdateUserPayload) ProtoMessage

func (*UpdateUserPayload) ProtoMessage()

func (*UpdateUserPayload) ProtoReflect

func (x *UpdateUserPayload) ProtoReflect() protoreflect.Message

func (*UpdateUserPayload) Reset

func (x *UpdateUserPayload) Reset()

func (*UpdateUserPayload) String

func (x *UpdateUserPayload) String() string

type UserTaskClient

type UserTaskClient interface {
	// CreateUser 异步创建用户
	CreateUser(context.Context, *CreateUserPayload, ...asynq.Option) (*asynq.TaskInfo, error)
	// UpdateUser 异步更新用户
	UpdateUser(context.Context, *UpdateUserPayload, ...asynq.Option) (*asynq.TaskInfo, error)
}

func NewUserTaskClient

func NewUserTaskClient(client *asynq.Client, opts ...asynq_auxiliary.ClientOption) UserTaskClient

NewUserTaskClient new client. use default proto.Marhsal.

type UserTaskClientImpl

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

func (*UserTaskClientImpl) CreateUser

func (c *UserTaskClientImpl) CreateUser(ctx context.Context, in *CreateUserPayload, opts ...asynq.Option) (*asynq.TaskInfo, error)

CreateUser 异步创建用户

func (*UserTaskClientImpl) UpdateUser

func (c *UserTaskClientImpl) UpdateUser(ctx context.Context, in *UpdateUserPayload, opts ...asynq.Option) (*asynq.TaskInfo, error)

UpdateUser 异步更新用户

type UserTaskHandler

type UserTaskHandler interface {
	// CreateUser 异步创建用户
	CreateUser(context.Context, *CreateUserPayload) error
	// UpdateUser 异步更新用户
	UpdateUser(context.Context, *UpdateUserPayload) error
}

Jump to

Keyboard shortcuts

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