Documentation
¶
Overview ¶
Package job is the console-facing JobService handler: the daemon's CONTROL surface, the mutating sibling of the read-only activity/status/viewer handlers. Its RPCs submit background maintenance jobs (graph sync, activity-trail rotate, cache clear) through the same fire-and-forget, coalescing proc mechanism the CLI's `server job` uses, so a double-click never starts a second copy. Each response carries a metadata snapshot - the job's running state, its last completed run (from the activity trail), and the current size of what it maintains - so a caller renders a job's state in one round trip. The daemon mounts it behind the bearer guard; it is never served unauthenticated.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements jobv1alpha1connect.JobServiceHandler. It submits jobs to the daemon's own proc socket (self-dial, so it rides the exact coalescing/journal path an external submit would) and reads the workspace trail + cache for the metadata it returns.
func NewService ¶
NewService builds a JobService handler over the workspace ws, submitting jobs as version.
func (*Service) ListJobs ¶
func (s *Service) ListJobs(ctx context.Context, _ *connect.Request[jobv1.ListJobsRequest]) (*connect.Response[jobv1.ListJobsResponse], error)
ListJobs returns every registered job with its running state, last run, and target size.
func (*Service) RunJob ¶ added in v0.4.0
func (s *Service) RunJob(ctx context.Context, req *connect.Request[jobv1.RunJobRequest]) (*connect.Response[jobv1.RunJobResponse], error)
RunJob submits the named job. An unregistered name is NotFound rather than a SubmitState: the enum reports how a valid submission resolved, and a name nobody registered never became one. That is also why this is the only RPC that can reject its input - the four verbs it replaced took no argument, so they had nothing to get wrong.