RegisterPools registers connection pools with the global recorder.
(connPool pool.Pooler, pubSubPool PubSubPooler, addr string)
| 268 | |
| 269 | // RegisterPools registers connection pools with the global recorder. |
| 270 | func RegisterPools(connPool pool.Pooler, pubSubPool PubSubPooler, addr string) { |
| 271 | // Check if the global recorder implements PoolRegistrar |
| 272 | if registrar, ok := globalRecorder.(PoolRegistrar); ok { |
| 273 | // Generate a unique ID for this client's pools |
| 274 | uniqueID := generateUniqueID() |
| 275 | |
| 276 | if connPool != nil { |
| 277 | poolName := addr + "_" + uniqueID |
| 278 | registrar.RegisterPool(poolName, connPool) |
| 279 | } |
| 280 | if pubSubPool != nil { |
| 281 | poolName := addr + "_" + uniqueID + "_pubsub" |
| 282 | registrar.RegisterPubSubPool(poolName, pubSubPool) |
| 283 | } |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | // UnregisterPools removes connection pools from the global recorder |
| 288 | func UnregisterPools(connPool pool.Pooler, pubSubPool PubSubPooler) { |
no test coverage detected