-
Notifications
You must be signed in to change notification settings - Fork 746
Conversation
这样包还是有点问题,我把sync_module_worker也改了再合 |
@@ -17,53 +17,51 @@ | |||
var thunkify = require('thunkify-wrap'); | |||
var urllib = require('urllib'); | |||
var config = require('../config'); | |||
var co = require('co'); | |||
thunkify(urllib, ['request']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里有一个疑问,如果 urllib 已经被 thunkify过了,再thunkify一次会有什么效果?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯 会出问题, 我看看能不能thunkify解决,不然就只能统一封装一个co-urllib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我弄一个co-urllib 吧
https://github.com/dead-horse/co-urllib |
要不就在 thunkify-wrap 里面判断好了,如果被转换过,就不再转换了。 |
嗯 我加上了,thunkify 一个 thunk,还是能执行,只是函数被多包了一层。。 |
太刁了。。。 @fengmk2 (https://twitter.com/fengmk2) 记得当时年纪小/ On Thursday, March 6, 2014 at 10:21 AM, dead_horse wrote:
|
ok,这个办法不错
|
but SyncModuleWorker still use callback type npm.js, so just use co wrap to thunk. after refactor SyncModuleWorker, remove this co wrap.
review 一下 |
]; | ||
var moduleRows = result[0]; | ||
var tagRows = result[1]; | ||
var existsStarUsers = result[2]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
existsStarUsers 是 array, 下面判断会都认为是 false的, 需要将它转换成 map
{ fengmk2: true, tj: true }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_listStarUsers
里面已经转成这个形式了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
+1 终于搞定! 等会我就开启同步看看 |
紧急修复了一下 add star user 添加到 deps里面去的问题 c43b117 |
.. |
晚安, 明天一切顺利! @fengmk2 (https://twitter.com/fengmk2) 记得当时年纪小/ On Saturday, March 8, 2014 at 12:25 AM, dead_horse wrote:
|
sync
use generatorproxy/npm.js
use generatorsync_module_worker.js
useproxy/npm.js
by callback type, so just useco
wrap them firstafter refactor
sync_module_worker.js
, remove this wrap