* 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).
()
| 61 | * and dispatching (queue processor path). |
| 62 | */ |
| 63 | tryStart(): number | null { |
| 64 | if (this._status === 'running') return null |
| 65 | this._status = 'running' |
| 66 | ++this._generation |
| 67 | this._notify() |
| 68 | return this._generation |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * End a query. Returns true if this generation is still current |