Documentation ¶
Overview ¶
Package worker implements the generic cron worker logic.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResultFilename ¶
func ResultFilename(sbr *data.ScorecardBatchRequest) string
ResultFilename returns the filename where the result from processing a batch request should go. This naming convention is used to detect duplicate requests, as well as transfer the results to BigQuery.
Types ¶
type WorkLoop ¶
type WorkLoop struct {
// contains filtered or unexported fields
}
WorkLoop is the entry point into the common cron worker structure.
func NewWorkLoop ¶
NewWorkLoop creates a workloop using a specified worker.
type Worker ¶
type Worker interface { Process(ctx context.Context, req *data.ScorecardBatchRequest, bucketURL string) error PostProcess() }
Worker is the interface used to process batch requests.
Process does the processing for a batch request. Returning an error will cause the request to be nack'd, allowing it to be re-processed later. If no error is returned, the request will be ack'd, consuming it.
PostProcess is called only after an error-free call to Process.