Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecutorType ¶
type ExecutorType string
const ( ExecutorTypeThread ExecutorType = "thread" ExecutorTypeProcess ExecutorType = "process" )
type InitializeRequest ¶
type InitializeResponse ¶
type InitializeResponse struct {
Error string `json:"error,omitempty"`
}
type JobExecutor ¶
type Message ¶
type Message struct {
Type MessageType `json:"type"`
Payload json.RawMessage `json:"payload,omitempty"`
}
type MessageType ¶
type MessageType string
const ( MessageTypeInitializeRequest MessageType = "initialize_request" MessageTypeInitializeResponse MessageType = "initialize_response" MessageTypePingRequest MessageType = "ping_request" MessageTypePongResponse MessageType = "pong_response" MessageTypeStartJobRequest MessageType = "start_job_request" MessageTypeShutdownRequest MessageType = "shutdown_request" MessageTypeExiting MessageType = "exiting" )
type PingRequest ¶
type PingRequest struct {
Timestamp int64 `json:"timestamp"`
}
type PongResponse ¶
type ProcPool ¶
type ProcPool struct {
// contains filtered or unexported fields
}
func NewProcPool ¶
func NewProcPool(maxProcesses int, executorType ExecutorType, entrypoint func() error) *ProcPool
func (*ProcPool) GetExecutors ¶
func (p *ProcPool) GetExecutors() []JobExecutor
type ProcessJobExecutor ¶
type ProcessJobExecutor struct {
// contains filtered or unexported fields
}
func NewProcessJobExecutor ¶
func NewProcessJobExecutor(id string) *ProcessJobExecutor
func (*ProcessJobExecutor) ID ¶
func (e *ProcessJobExecutor) ID() string
func (*ProcessJobExecutor) Started ¶
func (e *ProcessJobExecutor) Started() bool
func (*ProcessJobExecutor) Status ¶
func (e *ProcessJobExecutor) Status() JobStatus
type ShutdownRequest ¶
type ShutdownRequest struct {
Reason string `json:"reason"`
}
type StartJobRequest ¶
type ThreadJobExecutor ¶
type ThreadJobExecutor struct {
// contains filtered or unexported fields
}
func NewThreadJobExecutor ¶
func NewThreadJobExecutor(id string, entrypoint func() error) *ThreadJobExecutor
func (*ThreadJobExecutor) ID ¶
func (e *ThreadJobExecutor) ID() string
func (*ThreadJobExecutor) Started ¶
func (e *ThreadJobExecutor) Started() bool
func (*ThreadJobExecutor) Status ¶
func (e *ThreadJobExecutor) Status() JobStatus
Click to show internal directories.
Click to hide internal directories.