Commit 23fdbdf
feat(tui): Add data handles for real-time network stats polling
Added API methods to support background RPC polling:
New Public Methods:
- get_network_stats_handle() → Arc<Mutex<NetworkStats>>
- get_live_tx_handle() → Arc<Mutex<Vec<LiveTransaction>>>
These enable background threads to update TUI data structures.
Usage Pattern:
```rust
let stats_handle = app.get_network_stats_handle();
let tx_handle = app.get_live_tx_handle();
std::thread::spawn(move || {
loop {
// Fetch from RPC
let stats = fetch_network_stats(&rpc_url);
*stats_handle.lock().unwrap() = stats;
sleep(5 secs);
}
});
```
Foundation Complete:
✅ NetworkStats data structure
✅ LiveTransaction data structure
✅ render_network_stats_panel() UI
✅ Thread-safe Arc<Mutex<>> handles
✅ Integrated into dashboard layout
Next: Wire up actual RPC calls in background thread
🔧 Generated with Claude Code
Co-Authored-By: Claude <[email protected]>1 parent e7767cd commit 23fdbdf
1 file changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
270 | 280 | | |
271 | 281 | | |
272 | 282 | | |
| |||
0 commit comments