types

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executable

type Executable interface {
	Execute(context.Context, any) (any, error)
}

type Payload

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

Payload encapsulates a job and its input into a neat package to be executed by another thread.

func NewPayload

func NewPayload(ctx context.Context, job Executable, args any) *Payload

NewPayload creates a new payload to send to a worker.

func (Payload) Execute

func (p Payload) Execute()

Execute executes the job and returns the result.

type Resultor

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

Result encapsulates the result of a job execution.

func (*Resultor) Error

func (r *Resultor) Error() error

Error returns the error of the job execution.

func (*Resultor) Result

func (r *Resultor) Result() any

Result returns the result of the job execution.

Jump to

Keyboard shortcuts

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