Node.js IT 狗討論區

260 回覆
22 Like 35 Dislike
2022-01-05 17:43:27
煩呀,我諗,如果有mutithread,客流量又唔太高嘅話,其實無乜需要做async?

同埋未有async await之前,要寫async logic都幾多boilerplate

當然而家情況唔同晒啦
2022-01-05 19:12:50
其實無需要一定要async,django / python 全部行sync,一樣無問題;同埋有時可以用task queue 去搞

有特定use case用async就啱
2022-01-06 09:54:28
async non-blocking I/O呢個係作者本身既哲學黎
佢係先有左呢個概念想整呢種architecture先會去揀javascript做language
所以無得解...本身係作者自high用...其實唔太在意成唔成功
2022-01-06 10:35:36
自high用
2022-01-17 21:28:59
有冇人用過 https://blitzjs.com/
2022-01-17 23:55:11
同最新版 next.js 差不多
2022-01-18 00:14:45
佢係 built on Next.js,多左啲功能
2022-01-18 00:16:37
2022-01-18 00:17:08
慣左愈少野愈好
2022-01-18 08:21:38
就咁睇blitzjs 方便好多,define 完 schema 仲可以直接import 返個type
如果nextjs 用ts寫,要成日typeof query.xxx !== 'string'
 if (typeof query.page !== 'string') {
  return;
}

await db.find({ page: query.page })

跟住又要check method
if (req.method !== 'GET') {
  return res.status(405).send('Method Not Allowed');
}
吹水台自選台熱 門最 新手機台時事台政事台World體育台娛樂台動漫台Apps台遊戲台影視台講故台健康台感情台家庭台潮流台美容台上班台財經台房屋台飲食台旅遊台學術台校園台汽車台音樂台創意台硬件台電器台攝影台玩具台寵物台軟件台活動台電訊台直播台站務台黑 洞