|
3 | 3 | * @brief Implementation of the EventBridge class for bridging between C-style |
4 | 4 | * async context and C++ event handling. |
5 | 5 | * |
6 | | - * This file implements the EventBridge class, which provides a foundation for event handlers with proper core affinity in the AsyncTcpClient library. |
7 | | - * It supports explicit initialization and registration of worker types: |
| 6 | + * This file implements the EventBridge class, which provides a foundation for |
| 7 | + * event handlers with proper core affinity in the AsyncTcpClient library. It |
| 8 | + * supports explicit initialization and registration of worker types: |
8 | 9 | * |
9 | | - * 1. Persistent "when pending" workers - Registered via initialisePerpetualBridge(). |
10 | | - * These remain registered with the context manager until explicitly removed. Registration is no longer automatic in the constructor. |
| 10 | + * 1. Persistent "when pending" workers - Registered via |
| 11 | + * initialisePerpetualBridge(). These remain registered with the context manager |
| 12 | + * until explicitly removed. Registration is no longer automatic in the |
| 13 | + * constructor. |
11 | 14 | * |
12 | 15 | * 2. Ephemeral "at time" workers - Registered via initialiseEphemeralBridge(). |
13 | | - * These execute once at a specific time and are automatically removed from the context manager after execution. They can optionally manage their own lifecycle through self-ownership. |
| 16 | + * These execute once at a specific time and are automatically removed from |
| 17 | + * the context manager after execution. They can optionally manage their own |
| 18 | + * lifecycle through self-ownership. |
14 | 19 | * |
15 | | - * The implementation manages worker registration, lifecycle, and event execution, following the Template Method pattern. It provides thread-safe execution with core affinity guarantees and a clean separation between async mechanisms and business logic. |
| 20 | + * The implementation manages worker registration, lifecycle, and event |
| 21 | + * execution, following the Template Method pattern. It provides thread-safe |
| 22 | + * execution with core affinity guarantees and a clean separation between async |
| 23 | + * mechanisms and business logic. |
16 | 24 | * |
17 | 25 | * @ingroup AsyncTCPClient |
18 | 26 | */ |
@@ -81,9 +89,10 @@ namespace async_tcp { |
81 | 89 | async_work_on_timeout *worker) { // NOLINT |
82 | 90 | (void)context; |
83 | 91 | if (worker && worker->user_data) { |
84 | | - const auto pBridge = static_cast<EventBridge *>(worker->user_data); |
85 | | - pBridge->doWork(); |
86 | | - pBridge->releaseOwnership(); |
| 92 | + const auto local_bridge = |
| 93 | + static_cast<EventBridge *>(worker->user_data) |
| 94 | + ->releaseOwnership(); |
| 95 | + local_bridge->doWork(); |
87 | 96 | } else { |
88 | 97 | DEBUGV("\033[1;31m[AC-%d][%llu][ERROR] " |
89 | 98 | "EventBridge::ephemeral_bridging_function - invalid worker " |
|
0 commit comments