class documentation

Require a hyperlink DecodedURL object from a Requirer.

Present Since
Klein NEXT
Method finalize Nothing to do upon finalization.
Method injectValue Return a value to be injected into the parameter name specified by the IRequiredParameter. This may return a Deferred, or an object, or an object directly providing the relevant interface.
Method registerInjector Register the given injector at method-decoration time, informing it of its Python parameter name.
Class Variable interface Undocumented
def finalize(cls): (source)

Nothing to do upon finalization.

def injectValue(self, instance, request, routeParams): (source)

Return a value to be injected into the parameter name specified by the IRequiredParameter. This may return a Deferred, or an object, or an object directly providing the relevant interface.

Parameters
instance:AnyThe instance to which the Klein router processing this request is bound.
request:IRequestThe request being processed.
routeParams:Dict[str, Any]A (read-only) copy of the the arguments passed to the route by the layer below dependency injection (for example, URL parameters).
Returns
DecodedURLUndocumented
def registerInjector(self, injectionComponents, parameterName, requestLifecycle): (source)

Register the given injector at method-decoration time, informing it of its Python parameter name.

Parameters
injectionComponents:ComponentizedUndocumented
parameterName:strUndocumented
requestLifecycle:IRequestLifecycleUndocumented
lifecycleAn IRequestLifecycle provider which contains hooks that will be run before and after each request. If this injector has shared per-request dependencies that need to be executed before or after the request is processed, this method should attach them to those lists. These hooks are supplied here rather than relying on injectValue to run the requisite logic each time so that DependencyInjectors may cooperate on logic that needs to be duplicated, such as provisioning a session.
Returns
IDependencyInjectorUndocumented
Note
this happens at route definition time, after all other injectors have been registered by IRequiredParameter.registerInjector.
interface: Type[Interface] = (source)

Undocumented