hapi icon indicating copy to clipboard operation
hapi copied to clipboard

Rename connection to listener or similar

Open geek opened this issue 12 years ago • 14 comments

Instead of server.connection() can we rename it to server.listener() or server.connectionListener()? Since its not creating a real connection to anything and is more about setting up a listener I think its more specific to rename it.

geek avatar Nov 20 '14 19:11 geek

Perhaps a method name prefixed by define would be appropriate to avoid misleading users into thinking that calling server.connection() will actually result in their server actively listening.

Perhaps a note should be added at the bottom of the server.connection() docs section clarifying the two-phase approach for defining then starting connections / listeners.

ggoodman avatar Nov 20 '14 19:11 ggoodman

Since server.connection() has a property listener (http://hapijs.com/api#serverconnectionoptions) it would be weird to call it listener()

AdriVanHoudt avatar Nov 20 '14 19:11 AdriVanHoudt

Does each server.connection represent an http server? They all have their own routing table and request lifecycle. If so I'm not sure that either is the appropriate name.

nvcexploder avatar Nov 21 '14 20:11 nvcexploder

yeah.. this is an awkward one.. i feel like @hueniverse had mentioned using realm as terminology somewhere, maybe that's appropriate here?

nlf avatar Nov 21 '14 20:11 nlf

Just throwing a new term out there for brainstorming: responder.

On Fri Nov 21 2014 at 3:54:23 PM Nathan LaFreniere [email protected] wrote:

yeah.. this is an awkward one.. i feel like @hueniverse https://github.com/hueniverse had mentioned using realm as terminology somewhere, maybe that's appropriate here?

— Reply to this email directly or view it on GitHub https://github.com/hapijs/hapi/issues/2192#issuecomment-64036018.

ggoodman avatar Nov 21 '14 21:11 ggoodman

@geek made a good comment a bit ago, what about origin, speaking specifically of: http://tools.ietf.org/html/rfc6454

tl; dr: "Roughly speaking, two URIs are part of the same origin (i.e., represent the same principal) if they have the same scheme, host, and port." -@geek

nvcexploder avatar Nov 21 '14 23:11 nvcexploder

that's not bad at all, i like origin and bonus points for having a fitting definition

nlf avatar Nov 21 '14 23:11 nlf

server.origin() server.origins

geek avatar Nov 21 '14 23:11 geek

That's all @geek - the TLDR is a direct quote from him.

nvcexploder avatar Nov 21 '14 23:11 nvcexploder

The quote was totally @geek's (edit to add quotations)

nvcexploder avatar Nov 21 '14 23:11 nvcexploder

@nvcexploder that was lifted from the rfc: http://tools.ietf.org/html/rfc6454#section-3.2

geek avatar Nov 21 '14 23:11 geek

SHSHSHHHHHHHhhhhhhh.

nvcexploder avatar Nov 21 '14 23:11 nvcexploder

I don't like origin. It's weird.

Connections make sense to me. I am going to stick with it for now. If someone comes up with a better name, we can add it as alias and keep it compatible.

hueniverse avatar Nov 22 '14 00:11 hueniverse

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

lock[bot] avatar Jan 09 '20 16:01 lock[bot]