Skip to content

Commit 92f78df

Browse files
committed
channel refactor
1 parent e98e0a9 commit 92f78df

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

core-tests/src/coroutine/channel.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#include "tests.h"
2-
#include "channel.h"
2+
3+
#include "coroutine_channel.h"
4+
5+
using swoole::coroutine::Channel;
36

47
using namespace swoole;
58
using namespace std;

include/channel.h include/coroutine_channel.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#include <list>
1111
#include <queue>
1212

13-
namespace swoole
14-
{
13+
namespace swoole { namespace coroutine {
14+
//-------------------------------------------------------------------------------
1515
class Channel
1616
{
1717
public:
@@ -124,4 +124,5 @@ class Channel
124124
return co;
125125
}
126126
};
127-
};
127+
//-------------------------------------------------------------------------------
128+
}}

src/coroutine/channel.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
+----------------------------------------------------------------------+
1515
*/
1616

17-
#include "channel.h"
17+
#include "coroutine_channel.h"
18+
19+
using swoole::coroutine::Channel;
1820

1921
#include <unordered_map>
2022

swoole_channel_coro.cc

+3-6
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@
1717
+----------------------------------------------------------------------+
1818
*/
1919

20-
#include "php_swoole.h"
20+
#include "php_swoole_cxx.h"
2121

22-
#ifdef SW_COROUTINE
23-
#include "swoole_coroutine.h"
24-
#include "channel.h"
22+
#include "coroutine_channel.h"
2523

26-
using namespace swoole;
24+
using swoole::coroutine::Channel;
2725

2826
static zend_class_entry *swoole_channel_coro_ce;
2927
static zend_object_handlers swoole_channel_coro_handlers;
@@ -257,4 +255,3 @@ static PHP_METHOD(swoole_channel_coro, stats)
257255
add_assoc_long_ex(return_value, ZEND_STRL("queue_num"), chan->length());
258256
}
259257

260-
#endif

0 commit comments

Comments
 (0)