Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Document onServer? #73

Open
magicmark opened this issue Jun 20, 2017 · 2 comments
Open

Document onServer? #73

magicmark opened this issue Jun 20, 2017 · 2 comments

Comments

@magicmark
Copy link
Contributor

magicmark commented Jun 20, 2017

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

@ljharb
Copy link
Collaborator

ljharb commented Jun 21, 2017

You'll be able to use it until the next major regardless; hopefully @goatslacker can comment on any long term plans around it.

@goatslacker
Copy link
Collaborator

onServer is public API and here to stay. It's how we can have access to app as well as the master process so that we can extend hypernova's server functionality.

👍 on documentation. I'll keep this open.

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

No branches or pull requests

3 participants