* Start a query. Returns the generation number on success, * or null if a query is already running (concurrent guard). * Accepts transitions from both idle (direct user submit) * and dispatching (queue processor path).
()
| 59 | * and dispatching (queue processor path). |
| 60 | */ |
| 61 | tryStart(): number | null { |
| 62 | if (this._status === 'running') return null |
| 63 | this._status = 'running' |
| 64 | ++this._generation |
| 65 | this._notify() |
| 66 | return this._generation |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * End a query. Returns true if this generation is still current |