pg

package
v0.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	Status       string `json:"status"`
	Name         string `json:"name"`
	Pattern      string `json:"pattern"`
	NextLaunchAt int64  `json:"naxtLaunchAt"`
}

type PG

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

func NewPG

func NewPG(host string) (*PG, error)

func (*PG) Close

func (pg *PG) Close()

func (*PG) CollectMetrics

func (pg *PG) CollectMetrics(ctx context.Context) error

func (*PG) CreateTask

func (pg *PG) CreateTask(ctx context.Context, task *stepper.Task) error

func (*PG) FailTask

func (pg *PG) FailTask(ctx context.Context, task *stepper.Task, err error, timeout time.Duration) error

func (*PG) FindNextJob

func (pg *PG) FindNextJob(ctx context.Context, statuses []string) (*stepper.Job, error)

func (*PG) FindNextTask

func (pg *PG) FindNextTask(ctx context.Context, statuses []string) (*stepper.Task, error)

func (*PG) GetRelatedTask

func (pg *PG) GetRelatedTask(ctx context.Context, task *stepper.Task) (*stepper.Task, error)

func (*PG) GetUnreleasedJobChildren

func (pg *PG) GetUnreleasedJobChildren(ctx context.Context, jobName string) (*stepper.Task, error)

func (*PG) GetUnreleasedTaskChildren

func (pg *PG) GetUnreleasedTaskChildren(ctx context.Context, task *stepper.Task) (*stepper.Task, error)

func (*PG) Init

func (pg *PG) Init(ctx context.Context) error

func (*PG) RegisterJob

func (pg *PG) RegisterJob(ctx context.Context, cfg *stepper.JobConfig) error

func (*PG) Release

func (pg *PG) Release(ctx context.Context, job *stepper.Job, nextLaunchAt time.Time) error

func (*PG) ReleaseTask

func (pg *PG) ReleaseTask(ctx context.Context, task *stepper.Task) error

func (*PG) SetState

func (pg *PG) SetState(ctx context.Context, task *stepper.Task, state []byte) error

func (*PG) UpdateTask added in v0.0.2

func (pg *PG) UpdateTask(ctx context.Context, name string, updatedLaunchAt time.Time) error

func (*PG) WaitForSubtasks

func (pg *PG) WaitForSubtasks(ctx context.Context, job *stepper.Job) error

func (*PG) WaitTaskForSubtasks

func (pg *PG) WaitTaskForSubtasks(ctx context.Context, task *stepper.Task) error

type Task

type Task struct {
	ID               string     `json:"_id"`
	CustomId         string     `bson:"custom_id"`
	Name             string     `json:"name"`
	Data             string     `json:"data"`
	JobId            string     `json:"jobId"`
	Parent           string     `json:"parent"`
	LaunchAt         int64      `json:"launchAt"`
	Status           string     `json:"status"`
	LockAt           *time.Time `json:"lock_at"`
	State            string     `json:"state"`
	MiddlewaresState string     `json:"middlewares_state"`
	Error            *string
	EngineContext    context.Context `json:"-"`
}

func (*Task) ToModel

func (t *Task) ToModel() *stepper.Task

Jump to

Keyboard shortcuts

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