Documentation ¶
Overview ¶
Package job specifies a consistent description of a render job.
Index ¶
- Constants
- Variables
- type Format
- type Job
- type Manager
- func (manager *Manager) Get(name string) (j *Job, ok bool)
- func (manager *Manager) Init(queueSize int)
- func (manager *Manager) List() (jobs []*Job)
- func (manager *Manager) New(yaml io.Reader, params yamlscene.Params) (j *Job, err error)
- func (manager *Manager) RenderJobs()
- func (manager *Manager) Stop()
- type Status
- type StatusCode
- type Storage
Constants ¶
View Source
const ( StatusNew StatusCode = 0 StatusRendering = 100 StatusReading = 101 StatusUpdating = 102 StatusWriting = 103 StatusDone = 200 StatusError = 500 )
View Source
const DefaultFormat = "png"
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct { Name string Source io.Reader Params yamlscene.Params SceneLog log.Logger RenderLog log.Logger // contains filtered or unexported fields }
func (*Job) ChangeStatus ¶
func (*Job) StatusChan ¶
type Manager ¶
type Manager struct { Storage Storage // contains filtered or unexported fields }
Manager maintains a render job queue and records completed jobs.
func NewManager ¶
NewManager creates a new, initialized job manager.
func (*Manager) Init ¶
Init initializes the manager. This function is called automatically by NewJobManager.
func (*Manager) RenderJobs ¶
func (manager *Manager) RenderJobs()
RenderJobs renders jobs in the queue until Stop is called.
type Status ¶
type StatusCode ¶
type StatusCode int
func (StatusCode) Finished ¶
func (code StatusCode) Finished() bool
func (StatusCode) GoString ¶
func (code StatusCode) GoString() string
func (StatusCode) Started ¶
func (code StatusCode) Started() bool
func (StatusCode) String ¶
func (code StatusCode) String() string
type Storage ¶
type Storage interface { OpenReader(job *Job) (rc io.ReadCloser, err error) OpenWriter(job *Job) (wc io.WriteCloser, err error) }
Storage defines an interface for a manager to store and retrieve render job results.
func NewFileStorage ¶
NewFileStorage creates a Storage based on a root directory.
Click to show internal directories.
Click to hide internal directories.