taskqueue

package
v0.0.0-...-02ad720 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(ctx context.Context, streamName string, natsClient *nats.Conn, telemetry *unitel.Telemetry, log logr.Logger) (*Client, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) RegisterHandler

func (c *Client) RegisterHandler(type_ string, handler Handler)

func (*Client) StartConsumer

func (c *Client) StartConsumer(ctx context.Context, consumerGroup string) error

func (*Client) Submit

func (c *Client) Submit(ctx context.Context, task Task) error

type CombinedError

type CombinedError struct {
	Errors []error
}

func (CombinedError) Error

func (e CombinedError) Error() string

type Handler

type Handler func(ctx context.Context, task Task) error

type Task

type Task struct {
	ID      string
	Type    string
	Payload json.RawMessage
}

func NewTask

func NewTask(type_ string, payload any) (Task, error)

Jump to

Keyboard shortcuts

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