Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit 9ce189b

Browse files
author
hamidr
committed
Ability to use old event loops #12
1 parent 4dbc073 commit 9ce189b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

includes/event_loop/event_loop_ev.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ namespace async_redis {
7070

7171
public:
7272
event_loop_ev();
73+
event_loop_ev(struct ev_loop *);
7374
void run();
7475

7576
socket_identifier_t watch(int, async_socket&);
@@ -87,7 +88,7 @@ namespace async_redis {
8788
void start(ev_io&);
8889

8990
private:
90-
struct ev_loop* loop_ = EV_DEFAULT;
91+
struct ev_loop* loop_;
9192
std::unordered_map<socket_id, std::unique_ptr<socket_queue>> watchers_;
9293
};
9394
}

src/event_loop/event_loop_ev.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ namespace async_redis {
44
namespace event_loop {
55

66
event_loop_ev::event_loop_ev()
7+
: loop_(EV_DEFAULT)
8+
{
9+
}
10+
11+
event_loop_ev::event_loop_ev(struct ev_loop* loop)
12+
: loop_(loop)
713
{
814
}
915

0 commit comments

Comments
 (0)