etcd: Index | Files

package schedule

import ""

Package schedule provides mechanisms and policies for scheduling units of work.


Package Files

doc.go schedule.go

type Job Uses

type Job func(context.Context)

type Scheduler Uses

type Scheduler interface {
    // Schedule asks the scheduler to schedule a job defined by the given func.
    // Schedule to a stopped scheduler might panic.
    Schedule(j Job)

    // Pending returns number of pending jobs
    Pending() int

    // Scheduled returns the number of scheduled jobs (excluding pending jobs)
    Scheduled() int

    // Finished returns the number of finished jobs
    Finished() int

    // WaitFinish waits until at least n job are finished and all pending jobs are finished.
    WaitFinish(n int)

    // Stop stops the scheduler.

Scheduler can schedule jobs.

func NewFIFOScheduler Uses

func NewFIFOScheduler() Scheduler

NewFIFOScheduler returns a Scheduler that schedules jobs in FIFO order sequentially

Package schedule imports 2 packages (graph) and is imported by 359 packages. Updated 2019-03-07. Refresh now. Tools for package owners.