asynq

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

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 RegisterUserTaskHandler

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

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 UnimplementedUserTaskHandlerImpl

type UnimplementedUserTaskHandlerImpl struct{}

func (*UnimplementedUserTaskHandlerImpl) UnmarshalBinary

func (*UnimplementedUserTaskHandlerImpl) UnmarshalBinary(b []byte, v any) error

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 {
	// SetMarshaler set marshal the binary encoding of v function.
	SetMarshaler(func(any) ([]byte, error)) UserTaskClient
	// 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) 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) SetMarshaler

func (c *UserTaskClientImpl) SetMarshaler(marshaler func(any) ([]byte, error)) UserTaskClient

SetMarshaler set marshal the binary encoding of v function.

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
	// UnmarshalBinary parses the binary data and stores the result
	// in the value pointed to by v.
	UnmarshalBinary([]byte, any) error
}

Jump to

Keyboard shortcuts

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