Permalink
Browse files

mq, break: deprecated mq.await.

  • Loading branch information...
xicilion committed Nov 3, 2017
1 parent 4fc8482 commit 5da1a51ad27232191fcc1c8e23ba4fd3ae9264ab
View
@@ -200,7 +200,6 @@
<ClInclude Include="include\encoding.h" />
<ClInclude Include="include\encoding_bson.h" />
<ClInclude Include="include\encoding_iconv.h" />
<ClInclude Include="include\ifs\AsyncWait.h" />
<ClInclude Include="include\ifs\Buffer.h" />
<ClInclude Include="include\ifs\BufferedStream.h" />
<ClInclude Include="include\ifs\Chain.h" />
@@ -438,9 +438,6 @@
<ClInclude Include="include\encoding_iconv.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\ifs\AsyncWait.h">
<Filter>Header Files\ifs</Filter>
</ClInclude>
<ClInclude Include="include\ifs\Buffer.h">
<Filter>Header Files\ifs</Filter>
</ClInclude>
View
@@ -200,7 +200,6 @@
<ClInclude Include="include\encoding.h" />
<ClInclude Include="include\encoding_bson.h" />
<ClInclude Include="include\encoding_iconv.h" />
<ClInclude Include="include\ifs\AsyncWait.h" />
<ClInclude Include="include\ifs\Buffer.h" />
<ClInclude Include="include\ifs\BufferedStream.h" />
<ClInclude Include="include\ifs\Chain.h" />
@@ -438,9 +438,6 @@
<ClInclude Include="include\encoding_iconv.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\ifs\AsyncWait.h">
<Filter>Header Files\ifs</Filter>
</ClInclude>
<ClInclude Include="include\ifs\Buffer.h">
<Filter>Header Files\ifs</Filter>
</ClInclude>
@@ -8,12 +8,12 @@
#ifndef ASYNCWAITHANDLER_H_
#define ASYNCWAITHANDLER_H_
#include "ifs/AsyncWait.h"
#include "ifs/Handler.h"
#include "Event.h"
namespace fibjs {
class AsyncWaitHandler : public AsyncWait_base {
class AsyncWaitHandler : public Handler_base {
FIBER_FREE();

This file was deleted.

Oops, something went wrong.
View
@@ -27,7 +27,6 @@ class mq_base : public object_base {
public:
// mq_base
static result_t await(obj_ptr<Handler_base>& retVal);
static result_t nullHandler(obj_ptr<Handler_base>& retVal);
static result_t invoke(Handler_base* hdlr, object_base* v, AsyncEvent* ac);
@@ -43,7 +42,6 @@ class mq_base : public object_base {
}
public:
static void s_await(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_nullHandler(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_invoke(const v8::FunctionCallbackInfo<v8::Value>& args);
@@ -62,7 +60,6 @@ namespace fibjs {
inline ClassInfo& mq_base::class_info()
{
static ClassData::ClassMethod s_method[] = {
{ "await", s_await, true },
{ "nullHandler", s_nullHandler, true },
{ "invoke", s_invoke, true },
{ "invokeSync", s_invoke, true }
@@ -86,20 +83,6 @@ inline ClassInfo& mq_base::class_info()
return s_ci;
}
inline void mq_base::s_await(const v8::FunctionCallbackInfo<v8::Value>& args)
{
obj_ptr<Handler_base> vr;
METHOD_NAME("mq.await");
METHOD_ENTER();
METHOD_OVER(0, 0);
hr = await(vr);
METHOD_RETURN();
}
inline void mq_base::s_nullHandler(const v8::FunctionCallbackInfo<v8::Value>& args)
{
obj_ptr<Handler_base> vr;
@@ -44,10 +44,4 @@ result_t AsyncWaitHandler::end()
return 0;
}
result_t mq_base::await(obj_ptr<Handler_base>& retVal)
{
retVal = new AsyncWaitHandler();
return 0;
}
} /* namespace fibjs */
@@ -19,9 +19,7 @@ namespace fibjs {
static void _done(const v8::FunctionCallbackInfo<v8::Value>& args)
{
AsyncWait_base* v = AsyncWait_base::getInstance(args.Data()->ToObject());
if (v)
v->end();
((AsyncWaitHandler*)Handler_base::getInstance(args.Data()->ToObject()))->end();
args.GetReturnValue().SetUndefined();
}
View

This file was deleted.

Oops, something went wrong.
View
@@ -39,25 +39,6 @@ module mq
/*! @brief 创建一个消息处理器路由对象,参见 Routing*/
static Routing;
/*! @brief 创建一个异步等待处理器
异步等待处理器用于需要异步处理的消息处理模式,示例如下:
```JavaScript
function func(v){
var await = mq.await();
call_some_async_func(v1, v2, v3, function() {
await.end();
});
return await;
}
```
示例是一个 javascript 消息处理函数,当函数返回时,消息处理引擎将等待 await,直到 await.end 被调用,才继续下一阶段的处理。
@return 返回创建的处理器
*/
static Handler await();
/*! @brief 创建一个空处理器对象,次处理对象不做任何处理直接返回
@return 返回空处理函数
*/

0 comments on commit 5da1a51

Please sign in to comment.