manakai PSGI extensions

manakai PSGI extensions

[14] This specification defines manakai's extensions to the PSGI specification.

Transport integration

[6] To construct the environment, the rules to prepare metavariables MUST be used with scheme key name psgi.url_scheme.

Server state API

[1] A PSGI server MAY set a value for the key manakai.server.state in the environment. If the key exists and its value is defined, the value MUST be a server state object.

[2] A server state object is a PSGI server dependent object.

[8] Every invocation of a PSGI application within the same server session MUST have the same manakai.server.state value in their environments. How to determine the server session is PSGI server dependent.

[9] Typically, all the invocations of a PSGI application in a single worker process of a preforking PSGI server implementation live in the same server session.

[10] The PSGI server MAY provide a way for the application to specify the server state object for a server session. It SHOULD also define a way to cleanly discard the server state object.

[12] For example, the PSGI server can invoke the destroy method of the server state object just before the server session is discarded.

[13] It is intended that the application can use the server state object to keep references to objects which live longer than a single PSGI application invocation, such as database connection client objects, and can discard them safely when the server is shutdown.

Terminology

[4] This specification depends on the Infra Standard.

[7] The terms hash key, hash value, exists, defined, and object are Perl terms.

[3] The terms PSGI server, PSGI application, environment, and psgi.url_scheme are defined by the PSGI specification.

[5] The term prepare metavariables is defined by the Web Transport Processing specification.

[11] For the purpose of this specification, an application is an application server program which has a PSGI application.

License

[15] Per CC0 https://creativecommons.org/publicdomain/zero/1.0/, to the extent possible under law, the author of this specification has waived all copyright and related or neighboring rights to this specification.

Notes