diff options
author | antirez <antirez@gmail.com> | 2011-11-21 16:05:29 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2011-11-21 16:05:29 +0100 |
commit | f14479c796fbf00c41ceefdcb4bec04df46f53ce (patch) | |
tree | a815a0ed4919c79847ffcc853fc9a2ff9a3f9a09 | |
parent | 491c1c4e044ac18c25905d3aba5c1578d6da7502 (diff) | |
download | redis-f14479c796fbf00c41ceefdcb4bec04df46f53ce.tar.gz |
new ae.c API to get current events by file descriptor.
-rw-r--r-- | src/ae.c | 7 | ||||
-rw-r--r-- | src/ae.h | 1 |
2 files changed, 8 insertions, 0 deletions
@@ -118,6 +118,13 @@ void aeDeleteFileEvent(aeEventLoop *eventLoop, int fd, int mask) aeApiDelEvent(eventLoop, fd, mask); } +int aeGetFileEvents(aeEventLoop *eventLoop, int fd) { + if (fd >= AE_SETSIZE) return 0; + aeFileEvent *fe = &eventLoop->events[fd]; + + return fe->mask; +} + static void aeGetTime(long *seconds, long *milliseconds) { struct timeval tv; @@ -104,6 +104,7 @@ void aeStop(aeEventLoop *eventLoop); int aeCreateFileEvent(aeEventLoop *eventLoop, int fd, int mask, aeFileProc *proc, void *clientData); void aeDeleteFileEvent(aeEventLoop *eventLoop, int fd, int mask); +int aeGetFileEvents(aeEventLoop *eventLoop, int fd); long long aeCreateTimeEvent(aeEventLoop *eventLoop, long long milliseconds, aeTimeProc *proc, void *clientData, aeEventFinalizerProc *finalizerProc); |