Documentation ¶
Index ¶
Constants ¶
View Source
const JobServicePool = "JobService"
JobServicePool job service pool name
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JobServiceMonitorClient ¶
type JobServiceMonitorClient interface { // WorkerPoolHeartbeats retrieves worker pool heartbeats WorkerPoolHeartbeats() ([]*work.WorkerPoolHeartbeat, error) // WorkerObservations retrieves worker observations WorkerObservations() ([]*work.WorkerObservation, error) // Queues retrieves the job queue information Queues() ([]*work.Queue, error) }
JobServiceMonitorClient the interface to retrieve job service monitor metrics
type PoolManager ¶
type PoolManager interface { // List retrieves pools information List(ctx context.Context, monitorClient JobServiceMonitorClient) ([]*WorkerPool, error) }
PoolManager the interface to retrieve job service monitor metrics
func NewPoolManager ¶
func NewPoolManager() PoolManager
NewPoolManager create a PoolManager with namespace and redis Pool
type QueueManager ¶
type QueueManager interface {
List(ctx context.Context, monitClient JobServiceMonitorClient) ([]*Queue, error)
}
QueueManager defines the operation related to job service queue
type RedisClient ¶
type RedisClient interface { // AllJobTypes returns all the job types registered in the job service AllJobTypes(ctx context.Context) ([]string, error) // PauseJob pause the execution of the specified type job, except the running job PauseJob(ctx context.Context, jobName string) error // UnpauseJob resume the execution of the specified type job UnpauseJob(ctx context.Context, jobName string) error // StopPendingJobs stop the pending jobs of the specified type, and remove the jobs from the waiting queue StopPendingJobs(ctx context.Context, jobType string) (jobIDs []string, err error) }
RedisClient defines the job service operations related to redis
func JobServiceRedisClient ¶
func JobServiceRedisClient() (RedisClient, error)
JobServiceRedisClient function to create redis client for job service
func NewRedisClient ¶
func NewRedisClient(config *config.RedisPoolConfig) (RedisClient, error)
NewRedisClient create a redis client
type Worker ¶
type Worker struct { ID string `json:"id"` PoolID string `json:"pool_id"` IsBusy bool `json:"is_busy"` JobName string `json:"job_name"` JobID string `json:"job_id"` StartedAt int64 `json:"start_at"` CheckIn string `json:"check_in"` CheckInAt int64 `json:"check_in_at"` }
Worker job service worker
type WorkerManager ¶
type WorkerManager interface { // List lists all workers in the specified pool List(ctx context.Context, monitClient JobServiceMonitorClient, poolID string) ([]*Worker, error) }
WorkerManager ...
Click to show internal directories.
Click to hide internal directories.