Skip to content

src: split out per-binding state from Environment

src: make creating per-binding data structures easier

Enable the state associated with the individual bindings, e.g. fs or http2, to be moved out of the Environment class, in order for these to be more modular and for Environment to be come less of a collection of random data fields.

Do this by using a BaseObject as the data for callbacks, which can hold the per-binding state. By default, no per-binding state is available, although that can be configured when setting up the binding.

src: move HTTP/2 state out of Environment

Moves state that is specific to HTTP/2 into the HTTP/2 implementation as a cleanup.

src: move v8 stats buffers out of Environment

Moves state that is specific to the v8 binding into the v8 binding implementation as a cleanup.

src: move http parser state out of Environment

Moves state that is specific to HTTP/1 into the HTTP/1 implementation as a cleanup.

src: move fs state out of Environment

Moves state that is specific to the fs binding into the fs binding implementation as a cleanup.

src,doc: add documentation for per-binding state pattern

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading