rclone: github.com/ncw/rclone/fs/rc/jobs Index | Files

package jobs

import "github.com/ncw/rclone/fs/rc/jobs"


Package Files


func ExecuteJob Uses

func ExecuteJob(ctx context.Context, fn rc.Func, in rc.Params) (rc.Params, int64, error)

ExecuteJob executes new job synchronously and returns a Param suitable for output.

func OnFinish Uses

func OnFinish(jobID int64, fn func()) (func(), error)

OnFinish adds listener to jobid that will be triggered when job is finished. It returns a function to cancel listening.

func SetInitialJobID Uses

func SetInitialJobID(id int64)

SetInitialJobID allows for setting jobID before starting any jobs.

func SetOpt Uses

func SetOpt(opt *rc.Options)

SetOpt sets the options when they are known

func StartAsyncJob Uses

func StartAsyncJob(fn rc.Func, in rc.Params) (rc.Params, error)

StartAsyncJob starts a new job asynchronously and returns a Param suitable for output.

type Job Uses

type Job struct {
    ID        int64     `json:"id"`
    Group     string    `json:"group"`
    StartTime time.Time `json:"startTime"`
    EndTime   time.Time `json:"endTime"`
    Error     string    `json:"error"`
    Finished  bool      `json:"finished"`
    Success   bool      `json:"success"`
    Duration  float64   `json:"duration"`
    Output    rc.Params `json:"output"`
    Stop      func()    `json:"-"`
    // contains filtered or unexported fields

Job describes an asynchronous task started via the rc package

type Jobs Uses

type Jobs struct {
    // contains filtered or unexported fields

Jobs describes a collection of running tasks

func (*Jobs) Expire Uses

func (jobs *Jobs) Expire()

Expire expires any jobs that haven't been collected

func (*Jobs) Get Uses

func (jobs *Jobs) Get(ID int64) *Job

Get a job with a given ID or nil if it doesn't exist

func (*Jobs) IDs Uses

func (jobs *Jobs) IDs() (IDs []int64)

IDs returns the IDs of the running jobs

func (*Jobs) NewAsyncJob Uses

func (jobs *Jobs) NewAsyncJob(fn rc.Func, in rc.Params) *Job

NewAsyncJob start a new asynchronous Job off

func (*Jobs) NewSyncJob Uses

func (jobs *Jobs) NewSyncJob(ctx context.Context, in rc.Params) (*Job, context.Context)

NewSyncJob start a new synchronous Job off

Package jobs imports 10 packages (graph). Updated 2021-01-23. Refresh now. Tools for package owners.