task

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ModuleName = dep.Name("wk", "task")
)

Functions

func Module added in v0.1.1

func Module() dep.Module

Types

type Api added in v0.1.1

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

func (*Api) CancelTask added in v0.1.1

func (a *Api) CancelTask(ctx context.Context, request *CancelTaskRequest) (*CancelTaskResponse, error)

func (*Api) CreateTask added in v0.1.1

func (a *Api) CreateTask(ctx context.Context, request *CreateTaskRequest) (*CreateTaskResponse, error)

type Bucket added in v0.1.1

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

func (*Bucket) HasSlot added in v0.1.1

func (b *Bucket) HasSlot() bool

func (*Bucket) Reserve added in v0.1.1

func (b *Bucket) Reserve() (bool, SlotReleaser)

type CancelTaskRequest added in v0.1.1

type CancelTaskRequest struct {
	TaskID xid.ID `path:"task_id"`
}

type CancelTaskResponse added in v0.1.1

type CancelTaskResponse struct{}

type Client added in v0.1.1

type Client struct {
}

func (*Client) Run added in v0.1.1

func (c *Client) Run(ctx context.Context, name string, args any) (xid.ID, error)

func (*Client) RunSync added in v0.1.1

func (c *Client) RunSync(ctx context.Context, name string, args any) (any, error)

type CreateTaskRequest added in v0.1.1

type CreateTaskRequest struct {
	Name        string      `body:"name"`
	Args        interface{} `body:"args"`
	ContentType string      `body:"contentType"`
}

type CreateTaskResponse added in v0.1.1

type CreateTaskResponse struct {
	TaskID xid.ID `json:"taskID"`
}

type Manifest

type Manifest struct {
	Name        string `json:"name"`
	Payload     []byte `json:"payload"`
	PayloadType string `json:"payloadType"`
}

func MarshallJSON

func MarshallJSON(name string, args any) (*Manifest, error)

func MarshallMsgPack

func MarshallMsgPack(name string, args any) (*Manifest, error)

func (*Manifest) Unmarshal

func (m *Manifest) Unmarshal(v any) error

type SlotReleaser added in v0.1.1

type SlotReleaser func()

Jump to

Keyboard shortcuts

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