Documentation ¶
Index ¶
- func Init(db *pgxpool.Pool, cfg Config) error
- type Client
- func (c *Client) BatchCreateJobs(ctx context.Context, executorName string, args []model.CreateJobArgs) ([]int64, error)
- func (c *Client) Close()
- func (c *Client) CreateJob(ctx context.Context, executorName string, args model.CreateJobArgs) (sqlc.TinyJob, error)
- func (t *Client) DecreaseInFlight()
- func (c *Client) DeleteJobByID(ctx context.Context, executorName string, id int64) (sqlc.TinyJob, error)
- func (c *Client) DeleteJobByName(ctx context.Context, executorName, name string) (sqlc.TinyJob, error)
- func (c *Client) Fetch(ctx context.Context, executorName string) chan Job
- func (c *Client) Handler() http.Handler
- func (t *Client) IncreaseInFlight()
- func (c *Client) Migrate() error
- func (c *Client) QueryJobByID(ctx context.Context, executorName string, id int64) (sqlc.TinyJob, error)
- func (c *Client) QueryJobByName(ctx context.Context, executorName, name string) (sqlc.TinyJob, error)
- func (c *Client) RestartJob(ctx context.Context, executorName string, id int64) (sqlc.TinyJob, error)
- func (c *Client) SearchJobs(ctx context.Context, executorName string, args model.QueryJobsArgs) ([]sqlc.TinyJob, error)
- func (c *Client) StopJob(ctx context.Context, executorName string, id int64) (sqlc.TinyJob, error)
- func (c *Client) UpdateJobByID(ctx context.Context, executorName string, id int64, args model.UpdateJobArgs) (sqlc.TinyJob, error)
- func (c *Client) UpdateJobByName(ctx context.Context, executorName, name string, args model.UpdateJobArgs) (sqlc.TinyJob, error)
- type Config
- type Job
- type JobEntity
- type Scheduled
- func (j Scheduled[T]) Expr(expr string) Scheduled[T]
- func (j Scheduled[T]) Fetch(ctx context.Context) chan ScheduledJob[T]
- func (j Scheduled[T]) Name(name string) Scheduled[T]
- func (j Scheduled[T]) Retries(retries int) Scheduled[T]
- func (j Scheduled[T]) Schedule(ctx context.Context, state T) (sqlc.TinyJob, error)
- func (j Scheduled[T]) StartAt(at time.Time) Scheduled[T]
- func (j Scheduled[T]) Timeout(timeout int) Scheduled[T]
- type ScheduledJob
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { Resolver graph.Resolver MaxInFlight uint64 MaxFlushSize int FlushInterval time.Duration PollInterval time.Duration ResetInterval time.Duration OwnerSetter func(http.Handler) http.Handler // contains filtered or unexported fields }
func (*Client) BatchCreateJobs ¶ added in v0.1.10
func (*Client) DecreaseInFlight ¶
func (t *Client) DecreaseInFlight()
func (*Client) DeleteJobByID ¶
func (*Client) DeleteJobByName ¶
func (*Client) IncreaseInFlight ¶
func (t *Client) IncreaseInFlight()
func (*Client) QueryJobByID ¶
func (*Client) QueryJobByName ¶
func (*Client) RestartJob ¶
func (*Client) SearchJobs ¶
func (*Client) UpdateJobByID ¶
type Job ¶
TODO: This should be `InflightJob` as it has additional methods for committing/failing job. TODO: Client should not expose sqlc.TinyJob as type.
type Scheduled ¶ added in v0.1.12
type Scheduled[T any] struct { ExecutorName string State T // contains filtered or unexported fields }
func NewScheduled ¶ added in v0.1.12
func (Scheduled[T]) Fetch ¶ added in v0.1.12
func (j Scheduled[T]) Fetch(ctx context.Context) chan ScheduledJob[T]
type ScheduledJob ¶ added in v0.1.12
Click to show internal directories.
Click to hide internal directories.