task

package
v0.0.0-...-e2a1867 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SimpleWorkerTask

type SimpleWorkerTask struct {
	Task
}

SimpleWorkerTask - Just a simple http get

type Task

type Task struct {
	ID      int
	URL     string
	Request string // GET, POST, ...

	Response []byte // response
	// contains filtered or unexported fields
}

Task - describes the task a worker has to execute

func NewTask

func NewTask(url, request string, wait bool) *Task

NewTask -

func (*Task) IsSyncRequest

func (t *Task) IsSyncRequest() bool

IsSyncRequest -

func (*Task) PostProcess

func (t *Task) PostProcess()

PostProcess -

func (*Task) Receive

func (t *Task) Receive(client *http.Client) int

Receive -

func (*Task) String

func (t *Task) String() string

type WorkerTask

type WorkerTask interface {
	Receive(client *http.Client) int // receive http request
	PostProcess()                    // process received request if sync request
	IsSyncRequest() bool
}

WorkerTask -

Jump to

Keyboard shortcuts

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