worker

package
v0.0.0-...-2ce81c6 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2017 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Worker

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

Worker does the actual job of checking the balance, scheduling tasks, downloading audio files, transcribing them, etc.

func NewGCPWorker

NewGCPWorker creates a new worker that does its work using Google Cloud Platform.

func (*Worker) MaybeSchedule

func (w *Worker) MaybeSchedule(ctx context.Context) (bool, error)

MaybeSchedule checks the current balance and schedule new audio tracks to be transcribed. Simple greedy algorithm, should use dynamic programming if I want to optimize for the number of courses converted vs pure length. Returns whether new tasks were scheduled.

func (*Worker) Run

func (w *Worker) Run(ctx context.Context) error

Run checks for scheduled tasks and handle all of them if any.

Jump to

Keyboard shortcuts

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