Documentation ¶
Index ¶
- Variables
- type Dispatcher
- type Option
- func ClientAppName(s string) Option
- func ClientUploadBucketName(s string) Option
- func ClientUploadDestinationDirectory(s string) Option
- func ContainerBuildDirectory(s string) Option
- func ContainerSourceDirectory(s string) Option
- func GPUAffinity(n int) Option
- func JobQueueName(s string) Option
- func NumWorkers(n int) Option
- func OnClose(f func()) Option
- func OnWorkerClose(f func()) Option
- func Stderr(s io.WriteCloser) Option
- func Stdout(s io.WriteCloser) Option
- func TimeLimit(d time.Duration) Option
- type Options
- type Server
- type WorkRequest
- type Worker
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Config = &serverConfig{ done: make(chan struct{}), } DefaultRLimitFileSoft uint64 = 500000 DefaultRLimitFileHard uint64 = 500000 )
View Source
var ( DefaultContainerBuildDirectory = "/build" DefaultContainerSourceDirectory = "/src" )
View Source
var ( DefaultUploadExpiration = func() time.Time { return time.Now().AddDate(0, 6, 0) } )
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func StartDispatcher ¶
func StartDispatcher(numWorkers int64) *Dispatcher
func (*Dispatcher) Stop ¶
func (d *Dispatcher) Stop()
type Option ¶
type Option func(*Options)
func ClientAppName ¶
func ClientUploadBucketName ¶
func ContainerBuildDirectory ¶
func GPUAffinity ¶
func JobQueueName ¶
func NumWorkers ¶
func Stderr ¶
func Stderr(s io.WriteCloser) Option
func Stdout ¶
func Stdout(s io.WriteCloser) Option
type Server ¶
type Server struct { ID string // BeforeShutdown is an optional callback function that is called // before the server is closed. BeforeShutdown func() // AfterShutdown is an optional callback function that is called // after the server is closed. AfterShutdown func() // contains filtered or unexported fields }
func (*Server) Disconnect ¶
type WorkRequest ¶
type WorkRequest struct { *model.JobRequest // contains filtered or unexported fields }
func NewWorkerRequest ¶
func NewWorkerRequest(job *model.JobRequest, serverOpts Options) (*WorkRequest, error)
NewWorkerRequest ...
func (*WorkRequest) Close ¶
func (w *WorkRequest) Close() error
func (*WorkRequest) Start ¶
func (w *WorkRequest) Start() error
type Worker ¶
type Worker struct { ID string Work chan *WorkRequest WorkerQueue chan chan *WorkRequest QuitChan chan bool }
func NewWorker ¶
func NewWorker(id int64, workerQueue chan chan *WorkRequest) *Worker
Click to show internal directories.
Click to hide internal directories.