You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
inline constexpr int ISOLATED_CORE_PRIORITY_BOOST = 5;
96
99
inline constexpr int DEFAULT_REALTIME_PRIORITY = 80;
@@ -112,6 +115,9 @@ These can be overridden via preprocessor defines:
112
115
-`FLOX_DEFAULT_EVENTBUS_CAPACITY`
113
116
-`FLOX_DEFAULT_EVENTBUS_MAX_CONSUMERS`
114
117
-`FLOX_DEFAULT_ORDER_TRACKER_CAPACITY`
118
+
-`FLOX_DEFAULT_CONNECTOR_POOL_CAPACITY`
119
+
120
+
**Important:**`DEFAULT_CONNECTOR_POOL_CAPACITY` must be greater than `DEFAULT_EVENTBUS_CAPACITY`. EventBus only reclaims events on wrap-around, so if pool capacity ≤ bus capacity, the pool will exhaust before any events are returned.
The exhaustion callback is invoked each time `acquire()` returns `nullopt` due to pool exhaustion.
85
85
86
+
## Sizing Guidelines
87
+
88
+
When using pools with `EventBus`, the pool capacity **must be greater than** the EventBus capacity:
89
+
90
+
```cpp
91
+
// Correct: pool capacity (8191) > bus capacity (4096)
92
+
Pool<BookUpdateEvent, 8191> pool;
93
+
EventBus<Handle<BookUpdateEvent>, 4096> bus;
94
+
95
+
// Incorrect: will cause pool exhaustion
96
+
Pool<BookUpdateEvent, 4096> pool; // Same as bus = will exhaust!
97
+
EventBus<Handle<BookUpdateEvent>, 4096> bus;
98
+
```
99
+
100
+
**Why?** EventBus only reclaims events when the ring buffer wraps around. If pool capacity ≤ bus capacity, all pool slots will be in-flight before any can be returned.
101
+
102
+
The default `config::DEFAULT_CONNECTOR_POOL_CAPACITY` (8191) is sized for this reason when used with `DEFAULT_EVENTBUS_CAPACITY` (4096).
0 commit comments