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