Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Issue237 sync worker #253

Merged
merged 10 commits into from
Mar 7, 2014
Merged

Issue237 sync worker #253

merged 10 commits into from
Mar 7, 2014

Conversation

dead-horse
Copy link
Member

sync use generator
proxy/npm.js use generator

sync_module_worker.js use proxy/npm.js by callback type, so just use co wrap them first
after refactor sync_module_worker.js, remove this wrap

@dead-horse
Copy link
Member Author

这样包还是有点问题,我把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']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里有一个疑问,如果 urllib 已经被 thunkify过了,再thunkify一次会有什么效果?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯 会出问题, 我看看能不能thunkify解决,不然就只能统一封装一个co-urllib

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我弄一个co-urllib 吧

@dead-horse
Copy link
Member Author

https://github.com/dead-horse/co-urllib
之前搞过,但是现在觉得没太大必要。。

@fengmk2
Copy link
Member

fengmk2 commented Mar 6, 2014

要不就在 thunkify-wrap 里面判断好了,如果被转换过,就不再转换了。

@dead-horse
Copy link
Member Author

嗯 我加上了,thunkify 一个 thunk,还是能执行,只是函数被多包了一层。。
这个thunkify做的太精妙了。。

@fengmk2
Copy link
Member

fengmk2 commented Mar 6, 2014

太刁了。。。


@fengmk2 (https://twitter.com/fengmk2)
@python发烧友 (http://weibo.com/imk2/profile)
http://fengmk2.github.com (http://fengmk2.github.com/)


记得当时年纪小/
你爱谈天,我爱笑/
有一回并肩坐在桃树下/
风在林梢鸟儿在叫/
我们不知怎样睡着了/
梦里花落知多少

On Thursday, March 6, 2014 at 10:21 AM, dead_horse wrote:

嗯 我加上了,thunkify 一个 thunk,还是能执行,只是函数被多包了一层。。
这个thunkify做的太精妙了。。


Reply to this email directly or view it on GitHub (#253 (comment)).

@dead-horse
Copy link
Member Author

@fengmk2
Copy link
Member

fengmk2 commented Mar 6, 2014

ok,这个办法不错
2014年3月6日 AM10:25于 "dead_horse" [email protected]写道:

https://github.com/dead-horse/node-thunkify-wrap/blob/master/index.js#L65加了这个判断


Reply to this email directly or view it on GitHubhttps://github.com//pull/253#issuecomment-36818644
.

@dead-horse
Copy link
Member Author

review 一下

@fengmk2 fengmk2 added this to the v0.3 koa milestone Mar 7, 2014
@fengmk2 fengmk2 self-assigned this Mar 7, 2014
];
var moduleRows = result[0];
var tagRows = result[1];
var existsStarUsers = result[2];
Copy link
Member

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 }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_listStarUsers 里面已经转成这个形式了

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@fengmk2
Copy link
Member

fengmk2 commented Mar 7, 2014

+1 终于搞定! 等会我就开启同步看看

fengmk2 added a commit that referenced this pull request Mar 7, 2014
@fengmk2 fengmk2 merged commit 7db269e into master Mar 7, 2014
@fengmk2 fengmk2 deleted the issue237-sync-worker branch March 7, 2014 15:48
@fengmk2
Copy link
Member

fengmk2 commented Mar 7, 2014

紧急修复了一下 add star user 添加到 deps里面去的问题 c43b117

@dead-horse
Copy link
Member Author

..

@fengmk2
Copy link
Member

fengmk2 commented Mar 7, 2014

晚安, 明天一切顺利!


@fengmk2 (https://twitter.com/fengmk2)
@python发烧友 (http://weibo.com/imk2/profile)
http://fengmk2.github.com (http://fengmk2.github.com/)


记得当时年纪小/
你爱谈天,我爱笑/
有一回并肩坐在桃树下/
风在林梢鸟儿在叫/
我们不知怎样睡着了/
梦里花落知多少

On Saturday, March 8, 2014 at 12:25 AM, dead_horse wrote:

..


Reply to this email directly or view it on GitHub (#253 (comment)).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants