airbnb/hypernova

Document `onServer`?

Open

#73 创建于 2017年6月20日

在 GitHub 查看
 (2 评论) (1 反应) (1 负责人)JavaScript (249 fork)batch import
documentationhelp wanted

仓库指标

Star
 (5,831 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

I'm using onServer to be able to hook into express before the batch route is added, so I can do something like this: https://stackoverflow.com/a/21858212/4396258

(Context: we want to just restart workers if they consume too much memory, but specifically at the end of a request so we don't drop drop any requests)

It's either this or adding a workerShouldExit method as a config? What do you think? Can I safely use the onServer method, or is this subject to removal?

(Also on the subject of undocumented arguments - what about documenting context too? It's useful for collecting stats.)

@ljharb @goatslacker

贡献者指南