job

package
v0.0.0-...-077b43f Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2017 License: Apache-2.0 Imports: 2 Imported by: 5

Documentation

Overview

Package job implements the schedulable message(job) underlying storage.

Package job implements the schedulable message(job) underlying storage.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNothingDeleted = errors.New("nothing deleted")
)

Functions

This section is empty.

Types

type JobItem

type JobItem struct {
	JobId   int64
	Payload []byte
	Ctime   int64
	DueTime int64
}

func (JobItem) PayloadString

func (this JobItem) PayloadString(limit int) string

func (JobItem) String

func (this JobItem) String() string

type JobStore

type JobStore interface {

	// Name returns the underlying storage name.
	Name() string

	Start() error
	Stop()

	// CreateJobQueue creates a storage container where jobs will persist.
	CreateJobQueue(shardId int, appid, topic string) (err error)

	// Add pubs a schedulable message(job) synchronously.
	Add(appid, topic string, payload []byte, due int64) (jobId string, err error)

	// Delete removes a job by jobId.
	Delete(appid, topic, jobId string) (err error)
}

JobStore is the backend storage layer for jobs(schedulable message).

var Default JobStore

Directories

Path Synopsis
Package mysql implements a job store with mysql as backend.
Package mysql implements a job store with mysql as backend.

Jump to

Keyboard shortcuts

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