Update txworker pool definition#153
Conversation
WalkthroughThe worker pool API changed to require work items with a size_t parameter, propagating to the internal queue and worker-thread invocation. Implementation passes each worker’s ID to the work item. All call sites updated to provide lambdas accepting size_t; lambda bodies remain unchanged otherwise. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Caller
participant P as TxWorkerPool
participant Q as Work Queue
participant W as Worker Thread (id)
participant F as Work Item (fn(size_t))
C->>P: SubmitWork(F)
P->>Q: Enqueue F
Note over P,Q: Queue stores std::function<void(size_t)>
par Workers
loop Each worker thread
W->>Q: Dequeue F (if available)
Note over W: worker_id = thread index
W->>F: Invoke F(worker_id)
end
end
Note over F: Call sites may ignore the parameter
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
🧰 Additional context used🧬 Code graph analysis (1)include/tx_worker_pool.h (1)
🔇 Additional comments (10)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
In the function signature, add a
size_tparameter to identify the worker id.Summary by CodeRabbit
New Features
Refactor
Stability
Chores