Skip to content

Commit c0493c7

Browse files
committed
docs: add comments explaining event base priority levels
Added detailed comments to explain the priority system for libevent: - Priority 0 (highest): I/O events for immediate Redis response processing - Priority 1 (lower): Timer events for timeout handling after I/O processing This clarifies why I/O events are prioritized over timer events in the event processing loop.
1 parent 2aeef4a commit c0493c7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Fast.xs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ extern "C" {
2626
#define NANO_SECOND_TO_MICRO 1000
2727

2828
#define MIN_ATTEMPT_TO_GET_RESULT 2
29+
30+
// Event priorities:
31+
// Priority 0: I/O events (highest priority) - Process Redis responses immediately
32+
// Priority 1: Timer events (lower priority) - Handle timeouts after I/O processing
2933
#define EVENT_BASE_PRIORITY_NUMBER 2
3034

3135
#define DEBUG_MSG(fmt, ...) \

0 commit comments

Comments
 (0)