MCPcopy Index your code
hub / github.com/riverqueue/river / TryCloseSlot

Method TryCloseSlot

internal/jobexecutor/job_executor.go:138–140  ·  view source on GitHub ↗

TryCloseSlot marks this executor's producer slot as closed. A closed slot means the producer has already stopped counting this executor against its active worker capacity, although the executor goroutine may still be running. It returns true only the first time the slot is closed.

()

Source from the content-addressed store, hash-verified

136// active worker capacity, although the executor goroutine may still be running.
137// It returns true only the first time the slot is closed.
138func (e *JobExecutor) TryCloseSlot() bool {
139 return e.slotClosed.CompareAndSwap(false, true)
140}
141
142func (e *JobExecutor) Cancel(ctx context.Context) {
143 e.Logger.WarnContext(ctx, e.Name+": job cancelled remotely", slog.Int64("job_id", e.JobRow.ID))

Callers 2

removeActiveJobMethod · 0.80
handleWorkerStuckMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected