Skip to content

server.register callback handling does not enforce process.nextTick #3295

@csrl

Description

@csrl

According to the hapi style guide, a function taking a callback parameter must enforce the callback is called on process.nextTick.

However, server.register is dependent on whether or not the plugin.register handler calls its 'next' function asynchronously. Since plugin.register takes a 'next' parameter and not 'callback', it creates an inconsistent interface.

See hapijs/glue#72 and somewhat related #2516

server.register 'callback' should be changed to 'next' or it should enforce being called on process.nextTick according to the style guide.

Metadata

Metadata

Assignees

Labels

breaking changesChange that can breaking existing codebugBug or defect

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions